Created
March 28, 2021 16:16
-
-
Save autotel/720ca740654bd2196cd6f1e4b41724d3 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
touch "sounds.js"; | |
echo "module.exports={" > sounds.js; | |
for f in ./*.mp3; do | |
echo "base64 \"$f\" > \"$f.b64\""; | |
base64 "$f" > "$f.b64" | |
echo " \"$f\":\`$(base64 "$f")\`," >> "sounds.js" | |
done | |
echo "}" >> "sounds.js" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
convert a bunch of mp3 files into a js file that you could bundle in your js code. This has the effect of letting you bundle sounds into a single js file
Place it in the same folder where your mp3 files are and call it from console.
You can customize it to encode other types of too.