Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How do I randomize playback in a specific folder? #167

Open
Starlaw249 opened this issue Feb 16, 2022 · 1 comment
Open

How do I randomize playback in a specific folder? #167

Starlaw249 opened this issue Feb 16, 2022 · 1 comment

Comments

@Starlaw249
Copy link

How do I randomly select an audio track in a folder to loop playback
(for example I have 5 songs that I want to play at random in a folder called "music")

@BobHasNoSoul
Copy link

BobHasNoSoul commented Apr 16, 2022

this isnt really an issue with this project but i will try to help you random internet stranger

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

you will have to modify the folder locations and frequency listed but this will take your mp3s shuffle them and broadcast them over and over and over until you eventually want to curl up in a ball at disney world because the five nation army song just came on for the 200000000 time.

i got a little off topic there in short, use code above modify the folder from "/mnt/Music" to your music folder (yes nested work but may be slow on massive networked libraries) and modify the frequency as needed it is currently set in this post to 93.5mhz

hope this helps even though i am a little late to this thread

edit save the code above as a file named "shuffle.sh" then make it executable "chmod +x" and then you can run it with "./shuffle.sh"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants