Beaglebone black play audio with TCP command


I would like to write a c code which will play audio like wav or mp3 from USB audio adapter when it receives a TCP command from Ethernet interface. To do this I will use a cheap USB Audio Adapter and Beagle Bone Black. Can anybody help me to write the code from scratch ?

I need suggestions for this project.

USB Audio Adapter

A supported USB sound card would show up as /dev/audio and you can
either directly copy data to it, or use the command 'play'.
To trigger this by a TCP command, you could do something like this:

while (netcat -l 8080) ; do play sound.wav; done

will loop, waiting for connection to port 8080, and play the sound wav
file when the connection closes.
You can test this on your desktop by connecting to localhost
netcat localhost 8080