cancel
Showing results for 
Search instead for 
Did you mean: 

STM32F4 Discovery playback audio sample from custom Audio Library problem!

afcaball
Associate
Posted on January 04, 2014 at 23:49

Greetings,

I managed to create a custom Audio library with 17 wave samples (at 11Khz, 16-bit Stereo) that takes 380 KB ROM memory. The library is composed by 17 ''const arrays'' in the same way than the original one (called AUDIO_SAMPLE[]).

I can replace this original AUDIO_SAMPLE array with any of my own ones, it will play without any problem. But the problem, the strange problem comes when I insert into the project (its a Keil Uvision 5 project) my own audio library (audio_samples.c); if I invoke this function (inside ''WavePlayBack(uint32_t AudioFreq)''):

AudioFlashPlay((uint16_t*)(AUDIO_SAMPLE_2),AUDIO_FILE_SZE2,AUIDO_START_ADDRESS);

where Audio_File_sze2 and Auido_start_address are correct and audio_sample_2 is used in the same way than the original audio_sample; the new audio_sample is not being played, I deleted all generated files (clean target from Keil Uvision and manually), rebuild all and flashing with erase all sectors.

Sometimes, the STM32F4 plays part of the original audio sample, or only a part of any of the new ones, and very rare times, it can play a large variety of different samples from my new added library. With no code changes! Using the ''AudioFlashPlay'' function call with the intention to play the second of my sample waves.

I upload the audio library if someone want to try, I also can teach how to create audio library in .c code in an easier way.

In order to download the custom audio library file, click on the ''properties/attachments'' pnae at top right.

Thanks in advance for the help!

#stm32f4-audio-playback-custom
0 REPLIES 0