]> git.wh0rd.org - home.git/blame - .bin/flac2mp3
vcs-url: handle more repos
[home.git] / .bin / flac2mp3
CommitLineData
4a055602
MF
1#!/bin/bash
2
9b06fa70 3maxj=`getconf _NPROCESSORS_ONLN`
4a055602
MF
4jobs=()
5
6[[ $# -eq 0 ]] && set -- *.flac
7
8for f in "$@" ; do
9 m="${f%.flac}.mp3"
10 (
11 flac -sdc "${f}" | \
12 lame --silent -V 0 -h - "${m}"
13 id3cp "${f}" "${m}"
14 ) &
15 jobs+=( $! )
16 if [[ ${#jobs[@]} -eq ${maxj} ]] ; then
17 wait ${jobs[0]}
18 jobs=( ${jobs[@]:1} )
19 fi
20done
21
22wait