This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Can anybody help me how to import data from wav file to external memory CE0 of C6713?

Hello:

   I have got stuck by this problem for quite a long time and the due of my project is approaching, solving this problem becomes more urgent.  Due to the poor familiarity of the C6713 board and software-level development, I tried repeatedly and still didn't know how to effectively import data from wav file via the audio jack to the external memory of C6713 DSK.

  This is my code:

 

This code is simple.  I use Mcbsp API function to read in wav data from my mp3 player and use a temporal buffer to contain a frame of data. 

 

The testing result is very ugly and seems that my trial is in vain:

 

 

I want to load 0.1 value into the DSK but why when I checked the memory as floating point perspective, I didn't see 0.1?

 

 

 

 

However, one member gave me this suggestion:

 

I should consider the data type consistency.

I should amend endianess.

 

Can anybody give me some hints if you have the experience of importing audio signal from the mp3 or PC to the external memory of C6000 dsk?

 

I don't know why importing data from wav file into the memory is so difficult to implement!

 

 

 

thank you very much

Yu

 

 

  

 

 

 

 

  One of the members of E2E forum helped me with following suggestions:

 

 

 

  • Hi,
    Before copy to external memory, able to see the actual data on buffers and confirmed that same data got present on memory (destination).
  • Yu Zhang,

    These things you are saying do not connect to each other well, from this side of the forum. Your ISR writes to an array 'samples' of unknown type and size, you show what looks like a variable display of an array 'x' with a value of 0.1, you show a memory display starting at 0x80000000 which is not connected in our frame of reference to anything else in the post. If you have filled in this information in other similar posts, then you may understand why Titus has asked you not to post duplicate threads on the same issue.

    Your index in the for-loop is probably causing an overflow of the samples array when you run that loop each time in the ISR.

    If you uncomment the MCBSP_write() function call, do you get good sound coming out of the audio output port matching what your mp3 player was playing into the input port? If not, then you may have invalid data coming in so you must get that fixed before trying to figure out how to deal with your data.

    Do you understand what the data coming in from the McBSP port is supposed to look like, what the values should be, what the range of values should be, and whether it is actually a floating point number or an unsigned fixed point number or a signed fixed point number? It is probably a signed fixed point number, or it needs to be, but you are reading it into a Uint32 variable and then doing a strange casting trying to consider it to be a floating point number. This is all very confusing to me, so I suspect it is confusing to you.

    First, make sure the data coming in is correct by hearing it echoing back out through the MCBSP_write() function.

    Second. store the data without casting it to float. Look at the data using the graph function, or look at it using your own mental image of how the data should be changing for normal audio data. Make sure you believe that data is correct. And be sure whether it is a 32-bit number or two 16-bit numbers, or one 16-bit number that you are reading in.

    Third, understand that a fixed-point number is not the same as an integer. A fixed-point number has an implied binary point (like a decimal point) somewhere in the 32 bits of the number. Figure out what scaling is done or implied by the A/D that feeds the McBSP port and gets a number eventually into your temp variable.

    Fourth, figure out how to use scaling and C language to convert your input number to a floating point number, if you really need to do that.

    Regards,
    RandyP