markondej / fm_transmitter

Raspberry Pi as FM transmitter
1.3k stars 289 forks source link

sox WARN dither: dither clipped 421 samples; decrease volume? #149

Closed m626zNq closed 12 months ago

m626zNq commented 3 years ago

Every time I keep it on for about 30 minutes on loop, it says this and turns off everything. What should I do? Here is the cmd I use.

sox /home/pi/Private_Radio/RadioMusic/oldtown.wav /home/pi/Private_Radio/RadioMusic/lostboy.wav /home/pi/Private_Radio/RadioMusic/nightmarebefore.wav /home/pi/Private_Radio/RadioMusic/oldtown.wav /home/pi/Private_Radio/RadioMusic/savage.wav /home/pi/Private_Radio/RadioMusic/believer.wav -r 22050 -c 1 -b 16 -t wav - | sudo ./fm_transmitter -r -f 99.7 -

BobHasNoSoul commented 2 years ago

hey there, not the owner just love the project and want to help others. now that i have said that lets get into the helping part. you have a few wav files that you want to loop and even if it crashes (like you described) you want them to continue looping?

if so the simple course of action is to make a bash script to loop so that when it errors it runs another version of the same loop lets make one now nano shuffle.sh from the same directory you installed fm_transmitter

#!/bin/bash
for (( ; ; ))
do
    randsong="$(find '/home/pi/Private_Radio/RadioMusic' -type f -name '*.wav' | shuf -n1)"
    echo "$randsong"
    sox "$randsong" -r 22050 -c 1 -b 16 -t wav - | sudo ./fm_transmitter -f 99.7 - }
done
;;

this script will shuffle and loop all of these songs, you could even change it from wav to mp3 or whatever doesnt bother me, oh also to stop the shuffling and to play them in order or whatever just remove the shuffle part " | shuf -n1" and save it that will play them in alphabetical order.. or if you have another order this script should work the same with a loop that isnt quite as nice on the eyes.

#!/bin/bash
for (( ; ; ))
do
    sox /home/pi/Private_Radio/RadioMusic/oldtown.wav /home/pi/Private_Radio/RadioMusic/lostboy.wav /home/pi/Private_Radio/RadioMusic/nightmarebefore.wav /home/pi/Private_Radio/RadioMusic/oldtown.wav /home/pi/Private_Radio/RadioMusic/savage.wav /home/pi/Private_Radio/RadioMusic/believer.wav -r 22050 -c 1 -b 16 -t wav - | sudo ./fm_transmitter -r -f 99.7 -
done
;;

this will act just the same as your original command but loop it forever