markondej / fm_transmitter

Raspberry Pi as FM transmitter
1.32k stars 292 forks source link

Sox streaming conversion from mp3 to wav hangs at end of song #46

Closed playinmyblues closed 7 years ago

playinmyblues commented 7 years ago

Hi. I have been using sox to stream an mp3 to wav to the fm_transmitter program but the process hangs at the end of the song. I cannot figure out how to get it to continue.

I want to eventually build a web interface to play songs on the radio. I can write a shell script to play a series of songs using fm_transmitter directly with wav files. However, wav files are roughy 8x the size of an mp3 and that could eat up space quickly.

wav file shell script example: sudo ./fm_transmitter -f 92.9 wavFile1.wav sudo ./fm_transmitter -f 92.9 wavFile2.wav

sox/mp3 shell script: sox ~/Music/AlbumFolder/mp3File1.mp3 -r 22050 -c 1 -b 16 -t wav - | sudo ./fm_transmitter -f 92.9 - sox ~/Music/AlbumFolder/mp3File2.mp3 -r 22050 -c 1 -b 16 -t wav - | sudo ./fm_transmitter -f 92.9 -

These are essentially the examples you provided with your program in the README.md file. I have looked online to see if I can find an example that uses the format you have provided but have not been able to find anything yet.