Musepack Forums

Musepack Forums (https://forum.musepack.net/index.php)
-   MPC for UNIX (https://forum.musepack.net/forumdisplay.php?f=9)
-   -   Batch Encoding (https://forum.musepack.net/showthread.php?t=167)

bradmatic 26 March 2005 10:59 pm

Batch Encoding
 
Hello all,

Is there any way to batch encode a set of .wav's from the command-line? I've tried a couple of different sets of commands, but I usually only get one file encoded or an Error message.


Thanks!

Lefungus 30 March 2005 06:45 pm

Use Perl (or Ruby/Python). Here's a primitive example

compress.pl:
Code:

#/usr/bin/perl



$options = '--insane';



foreach $wav (<*.wav>) {

  $mpc = $wav;

  $mpc =~ s/.wav$/.mpc/;

  system('mppenc '.$options.' "'.$wav.'" "'.$mpc.'"');

}

and then type
Code:

/home/blah/Hyperhit Volume 3/perl compress.pl
It can probably be done in Bourne shell too.

KrzysiekW 03 April 2005 09:11 pm

Re: Batch Encoding
 
Quote:

Hello all,

Is there any way to batch encode a set of .wav's from the command-line?

Thanks!
I wrote a small bash script to convert all (.wav .ape .flac) audio files to mpc
Code:


#!/bin/bash



#quality

Q="6"





IFS=$'n'



for waves in $(ls *wav 2>/dev/null)

do

# mppenc --notags --quality $Q $waves || return 1

 mppenc --quality $Q $waves || return 1

 echo "=== deleting " $waves

 rm $waves

done



for waves in $(ls *ape 2>/dev/null)

do

 mac $waves $(echo $waves|sed 's/.ape$/.wav/') -d || return 1

# mppenc --notags --quality $Q $(echo $waves|sed 's/.ape$/.wav/') ||

 mppenc --quality $Q $(echo $waves|sed 's/.ape$/.wav/') || return 1

 echo "=== deleting " $waves

 rm $waves $(echo $waves|sed 's/.ape$/.wav/')

done



for waves in $(ls *flac 2>/dev/null)

do



# mppenc --notags --quality $Q $waves $(echo $waves|sed 's/.flac$/.mpc/')|| return 1

 mppenc --quality $Q $waves $(echo $waves|sed 's/.flac$/.mpc/')|| return 1

 echo "=== deleting " $waves

 rm $waves

done



All times are GMT. The time now is 03:54 pm.

Powered by vBulletin® Version 3.8.11 Beta 2
Copyright ©2000 - 2019, vBulletin Solutions Inc.