--In order to write the audio file to the SPI flash, first program FX3 with Flashprog example project available with FX3 SDK(C:\Program Files (x86)\Cypress\EZ-USB FX3 SDK\1.3\firmware\basic_examples\cyfxflashprog).
There is vendor command to write to the SPI Flash. You can use the same to write the audio data in the SPI flash.
bmRequestType = Vendor
bRequest = 0xC2
wValue = 0x0000
wIndex = 0x0000
I have attached one audio file. You may use any other audio file which will fit inside the SPI flash.
Out.audio.zip 163.0 K
I can now store audio file in the flash. But when I run the UAC example in FX3 SDK 1.3.3 and play the audio in the PC, the voice sounds incorrect.
Also, it looks like the audio file you provided is incorrect. It doesn't seems to be in correct PCM format.
I created a PCM file myself. You can see the attached files, the a.wav is the original audio file, and the pcm16x2.pcm is the converted PCM audio file to be stored in the flash. The audio format is 48000 sample rate, 2 channels, 16 bit.
Although I can hear the voice in the PC, there's noise and squeak.
What might be the cause of the issue?
I used USB Control Center application to write audio data to SPI Flash and The USBAudio class read the audio data from flash following are the observations.
1.I checked both write audio data and read data from spi are same.
2.Read data from spi and USB Endpoint data are same but Read data from spi and audacity recorded data are different see the attached files.
Please try with different audio players.