STMwavPlayerMR - WAV Player on STM32

preview_player
Показать описание
Рекомендации по теме
Комментарии
Автор

Hey ...do I need to use Timer with the I2S ?

braintraining
Автор

Hi there! Thanks for the code example. But I still don't get where do you increment the position of a file opened to read into the audio buffer ? I see you put a pointer after 44 header bytes. But there's no more ensuing lfseek() calls. I see how you define the pointer for the audio buffer, but for the file - i don't:
void play_wav(struct List *song, FRESULT fresult)
{
struct List *temporary_song=song;// pomocniczo, by nie dzialac na oryginale
UINT read_bytes;// uzyta w f_read
fresult = f_open( &file, temporary_song->file.fname, FA_READ );
if( fresult == FR_OK )
{
fresult=f_lseek(&file, 44);// pominiecie 44 B naglowka pliku .wav
volatile ITStatus it_status;// sprawdza flage DMA
change_song=0;

song_time[2]=':';
half_second=0;
display_const();
PCD8544_GotoXY(8, 15);
PCD8544_Puts(temporary_song->file.fname, PCD8544_Pixel_Set, PCD8544_FontSize_5x7);
TIM_Cmd(TIM3, ENABLE);
while(1)
{
if (read_and_send(fresult, 0, it_status, read_bytes, DMA_FLAG_HTIF5)==0)
{
break;
}
if (read_and_send(fresult, 1024, it_status, read_bytes, DMA_FLAG_TCIF5)==0)
{
break;
}
}
diode_state=0;
TIM_Cmd(TIM3, DISABLE);
fresult = f_close(&file);
PCD8544_Clear();
}
}

dkoxperiakoziukov
Автор

Missing information: supported bitrate, frequency, bits. For example 44Khz/16 bits or more?

ivan