Skip to content

Instantly share code, notes, and snippets.

#!/bin/bash
#Spawns n threads for transcoding n (all) m4a files in a folder into mp3 files
#for better thread managment using the following command with gnu parallel
# parallel ffmpeg -hide_banner -loglevel panic -i "{}" -acodec libmp3lame -ab 192K newfiles/"{.}.mp3" ::: *.m4a
for f in *.m4a;
do
ffmpeg -hide_banner -loglevel panic -i "$f" -acodec libmp3lame -ab 192K newfiles/"${f%.m4a}.mp3" &
function play(state){
var marching_order = state.turn;
//console.log(state.turn);
//sort the others array so the weaker ones are attacked first
if (state.others[0]){
state.others.sort(function (a, b) {
if (a.wrenches > b.wrenches) {
return 1;