cancel
Showing results for 
Search instead for 
Did you mean: 

stm32f746g disco play pcm audio from udp

Hpott.1
Associate

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

1 REPLY 1
Simon V.
ST Employee

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.