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.

CCS / TIDC-CC3200MODLAUNCHXL:WIFI AUDIO APP + SPI FLASH MEMORY

Part Number: TIDC-CC3200MODLAUNCHXL
Other Parts Discussed in Thread: CC3200

Tool/software: Code Composer Studio

I read the data from the external flash of the SPI memory and write them to the circular buffer pRecordByffer. How can I send this data to the audio codec to play them as a sound.

The data is a wav audio file with no title. Please help me with my problem, if you need any additional data, please write, I will add

  • Hi Georgiy,

    A few questions first:
    1) Are you successfully able to run the WiFi Audio example out of box?
    2) Have you verified that you are successfully reading data from flash?
    3) Are you using one or two devices? It sounds like you are using one, so is the flow of the audio:
    SPI Memory -> Device1 -> I2S Driver -> AUDBOOST

    Best regards,
    Kristen
  • Hello, dear Kristen
    thanks for the answer

    1) Yes, I have successfully run the Wifi_audio_app example
    2) Yes, I read the data from the flash correctly, I checked with a logic analyzer
    3) Yes, I use one device and I want to understand how to correctly use this part of the scheme: -> I2S Driver -> AUDBOOST

    Waiting for your reply
    Georgiy

  • Hi Georgiy,

    Currently the audio specs the example is using are: 16 kHz, 16 bit, stereo. If other quality is required, you will need to add that configuration within the AudioCodecConfig function. For this, see the reference guide of the audio codec IC on CC3200 AUDBOOST (www.ti.com/.../slaa408a.pdf).

    The contents of the RecordBuffer is what is transmitted to the second device in the context of the original Wifi Audio example. To play the audio locally, you should write the PCM data of the WAV file to the PlayBuffer, and the I2S driver will play the data that is in that buffer via the AUDBOOST.

    Best regards,
    Kristen
  • Hi Kristen,

    Thank you very much for your answer!

    If it's not hard for you, answer a few more questions:

    1) I did a cycle of reading spi and sending it to PlayBuffer one bit at a time. If you send more than one bit (at least two), the program hangs.

    Question:

    Do I need to write to the RecordBuffer, and then use the command:

    lRetVal = FillBuffer (pPlayBuffer, \
               (unsigned char *) (pRecordBuffer-> pucReadPtr), \
                                                     PACKET_SIZE);

    send to PlayBuffer, or write from SPI to PlayBuffer directly?

    2) Can you explain how this function works:

    UpdateReadPtr(pRecordBuffer, PACKET_SIZE);

    Now my program works like this:
    I read SPI FLASH and write to pRecordBuffer, then I send it to pPlayBuffer using the "FillBuffer" command, then (as I think) I update and zero pRecordBuffer with the "UpdateReadPtr" command. All this in the "for" loop, in which 34933 iterations in each occur with one bit.
    And I hear wheezing and hissing.

    3) Do I need a delay in each iteration or should the loop take place without pauses?

    So, you have already helped me, thank you very much for your answers

    Sorry for my bad english
    Best regards,
    Georgiy


  • Hi Georgiy,

    No need to apologize, I understand your questions!

    Since you are using an audio file and not recording audio from the microphone, I believe you should just be able to ignore what is in the microphone task, and also ignore the RecordBuffer.

    The FillBuffer() function is for writing data from one buffer to another. I would recommend using this function to write the audio data from flash to the PlayBuffer. I'm not sure how you were writing to the PlayBuffer before that it was causing it to hang if you wrote more than one bit at a time, but I would recommend writing to the PlayBuffer in bytes at least. The larger the chunks of data you use while writing, the less overhead there will be when playing audio.

    So in the speaker task, you'd do something like the psuedocode below:

    iRetVal = FillBuffer(pPlayBuffer, flashAudio, numAudioBytes)

    The pcm_handler.c will handle triggering the DMA transfer for you i.e. it will handle playing the audio from PlayBuffer.

    Best regards,
    Kristen

  • Thank you very much for your answer!