Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 23 Feb 1998 00:20:29 -0800
From:      Ben Cottrell <benco@pendor.McKusick.COM>
Cc:        multimedia@FreeBSD.ORG
Subject:   Re: Creating MP3's under FreeBSD... 
Message-ID:  <199802230820.AAA11778@pendor.McKusick.COM>
In-Reply-To: Your message of "Mon, 23 Feb 1998 11:09:08 %2B0300." <19980223110908.54543@sensi.org> 

next in thread | previous in thread | raw e-mail | index | archive | help
On Mon, 23 Feb 1998 11:09:08 +0300, vadik likholetov wrote:
> here's the script I'm using to create mp3's :

Vadik,

I notice your script stops and waits for each track before proceeding to
the next. This is inefficient, as ripping is an I/O bound task and
encoding a CPU-bound one. This is a perfect opportunity for multitasking.

Here's the script I use :-)
	~Ben



#!/bin/csh -f

set prog="$argv[1]" # program to encode mp3s with
set dir="$argv[2]" # dir in which to store mp3s
set tracks=(`cdd |& awk '/^ *[0-9][0-9] *CD-AUDIO *[^ ]* *[^ ]* *[^ ]* *[0-9][0-9]:[0-9][0-9]:[0-9][0-9] \/ [0-9][0-9][0-9][0-9][0-9][0-9] *[0-9]+ *$/ {print $1}'`)

foreach i ($tracks)
	if(!(-e ${dir}/track-${i}.mp3)) then
		if(!(-e ${dir}/track-${i}.cda)) then
			cdd -a -t $i $dir >& /dev/null
		endif
		wait
		($prog ${dir}/track-${i}.cda ${dir}/track-${i}.mp3;rm ${dir}/track-${i}.cda) &
	endif
end

wait

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-multimedia" in the body of the message



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199802230820.AAA11778>