Skip to main content
Visitor II
June 30, 2021
Question

stm32f746g disco play pcm audio from udp

  • June 30, 2021
  • 1 reply
  • 1174 views

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

    This topic has been closed for replies.

    1 reply

    ST Employee
    July 1, 2021

    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