Hello, On Thu, 07 May 2009, David C. Rankin wrote:
BASH/Audio gurus,
I'm working on a script that I hoped would eliminate the intermediate wav file in the process of converting my wma files to mp3. I created a named pipe with "mkfifo mppipe" (named for mplayer-pipe). What I am trying to do in the script is:
WMAFILE=$1 MP3FILE=${WMAFILE%.*}.mp3 WAVFILE=/home/david/music/mppipe
lame --preset extreme ${WAVFILE} ${MP3FILE} mplayer -vo null -vc dummy -af resample=44100 -ao pcm:file=${WAVFILE} ${WMAFILE}
A non-obvious variant, that took me too a bit of experimenting. Let the bash handle file descriptors! *g*: lame --preset extreme \ <( mplayer -msglevel all=-1 -novideo -vc null -vo null \ -ao pcm:waveheader:file=/dev/stdout \ -af volnorm,resample=44100 "${WMAFILE}" ) \ "$MP3FILE" Cool, innit? And lame shows something like: Encoding /dev/fd/63 to t.mp3 (if $MP3FILE is "t.mp3" ;) and it shows the normal progess stuff. (you might prefer mplayer -af ... over ffmpeg because of available filters, after all...) What also works, but without progress from lame: mplayer -msglevel all=-1 -novideo -vc null -vo null \ -ao pcm:waveheader:file=/dev/stdout \ -af volnorm,resample=44100 "${WMAFILE}" \ | lame --preset extreme - "$MP3FILE" The relevant mplayer-options are "-msglevel all=-1" and "-ao pcm:file=/dev/stdout" ('-' does not work). HTH (if not in this usecase, some other time), -dnh -- emacs, pr.n. An inferior operating system noted for the lack of a proper editor. -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org