2021-06-29 11:58 PM
hi
i am working on stm32f746 disco board and i want to play audio with board from online udp data. for this target i wrote a qt application to send pcm audio data over udp protocol and in stm32 program i use lwip receive function in a freertos task for receive data and play it. here is my code :
BSP_AUDIO_OUT_Play((uint16_t*)&audio_buf[0], sizeof(audio_buf));
nb = netbuf_new();
for(;;)
{
res=netconn_recv(nc,&nb);
len=netbuf_len(nb);
if(len>0)
{
netbuf_copy(nb,audio_buf,len);
}
netbuf_delete(nb);
osDelay(1);
}
whit this code i can receive and play audio but my audio is very noisy. iam not sure whats the best way to doing this. i think i shoud use interrups and freertos features like queue for best quality of audio but i dont know how to implement that. please help me.
thanks
2021-07-01 09:06 AM
Hello,
From my experience, audio frame should be sync with hardware interrupt like USB one.
I would try to avoid audio traffic management via RTOS but directly from peripheral IT.
Regards,
Simon
To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.