Results 1 to 4 of 4
i want to change all of the wav files to cdrs with sox and make a script that does it for me
i already have all of the files in ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
- 05-06-2003 #1Linux User
- Join Date
- Apr 2003
- Location
- TEXAS
- Posts
- 314
changing file types with sox
i want to change all of the wav files to cdrs with sox and make a script that does it for me
i already have all of the files in a directory i just dont know how to script
can anybody point me to a good scripting tutorial
- 05-06-2003 #2Linux Guru
- Join Date
- Oct 2001
- Location
- Täby, Sweden
- Posts
- 7,578
One idea is this:
Then you can rm *.wav if you deem the operation successful. It should work, though I haven't tried it.Code:for $file in *.wav; do sox -t .wav $file -t .cdr ${test%.wav}; done
Everything is documented in bash(1), so I don't really know if you need a tutorial. Might I suggest this:
If you don't have gv installed, use ggv instead. If you want to print it then (and you have enough physical papers for that), do this:Code:man -t bash >bashman.ps gv bashman.ps &
Code:man -t bash | lpr
- 05-06-2003 #3Linux User
- Join Date
- Apr 2003
- Location
- TEXAS
- Posts
- 314
says $file not proper identifier
it says the $file is not a proper identifer
why would it do that
- 05-06-2003 #4Linux Guru
- Join Date
- Oct 2001
- Location
- Täby, Sweden
- Posts
- 7,578
Sorry, that was just a typo. There shouldn't be a dollar sign at the first "file", like this:
There were some more typos as well, I must have been tired.Code:for file in *.wav; do sox -t .wav $file -t .cdr ${file%.wav}.cdr; done
That for command loops through all files matching *.wav, putting the filename in the variable file (which is accessed with $file). ${file%.wav}.cdr removes the .wav extension from $file, and add .cdr to it.
Like I said, it's all documented in bash(1).


Reply With Quote
