[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: rm to mp3



--- Punit Ahluwalia <punit_a@yahoo.com> wrote:
> Is there a way to convert real player format to mp3
> or wav?
> 

Wav is easiest

mplayer -ao pcm:file=file.wav source

here is a script which uses 
mplayer and external program lame to encode a mp3 
from source

#!/bin/bash
FIFO="MYFIFO"
PLAYER="mplayer"
ENCODER="lame"
PLAYER_LOC=`which $PLAYER`
ENCODER_LOC=`which $ENCODER`
PLAYER_OPTS="-ao pcm:file="$FIFO" -vo null -vc dummy "
ENCODER_OPTS=""

if [ $# -ne 2 ]; then
     echo "Usage: "$0" <source> <out filename>"
     exit 1
fi

if [ ${#PLAYER_LOC} -eq 0 ]; then
    echo "This requires "$PLAYER" be present in your
path"
    exit 1
fi

if [ ${#ENCODER_LOC} -eq 0 ]; then
    echo "This requires "$ENCODER" be present in your
path"
    exit 1
fi

if [ ! -f $FIFO ]; then
    mkfifo $FIFO
else
    echo "FIFO "$FIFO" already exists. Exiting"
    exit 1
fi

$PLAYER $PLAYER_OPTS ${1} &
$ENCODER $ENCODER_OPTS $FIFO ${2}
rm $FIFO



		
__________________________________ 
Do you Yahoo!? 
Yahoo! Mail - Helps protect you from nasty viruses. 
http://promotions.yahoo.com/new_mail



Reply to: