|
View:
New views
7 Messages
—
Rating Filter:
Alert me
|
|
|
Newbie QuestionsHi!
I just started using Sox today and have a few questions. 1. Is there an option to overwrite the input file instead of specifying a new file? 2. Is there a way to concatenate the following commands into a single command? sox.exe FileA.mp3 FileB.mp3 rate 44k loudness 10 channels 2 sox.exe -m FileB.mp3 FileC.mp3 -C 0 FileD.mp3 Thanks! -- Michael Horvath mikh2161@... http://isometricland.com ------------------------------------------------------------------------------ Come build with us! The BlackBerry(R) Developer Conference in SF, CA is the only developer event you need to attend this year. Jumpstart your developing skills, take BlackBerry mobile applications to market and stay ahead of the curve. Join us from November 9 - 12, 2009. Register now! http://p.sf.net/sfu/devconference _______________________________________________ Sox-users mailing list Sox-users@... https://lists.sourceforge.net/lists/listinfo/sox-users |
|
|
Re: Newbie QuestionsOn Sunday 11 October 2009 10:35 am, Michael Horvath wrote:
> I just started using Sox today and have a few questions. > > 1. Is there an option to overwrite the input file instead of specifying > a new file? Firstly this is dangerous if there is a failure for some reason .... ! Secondly what is "overwrite"? Some graphics applications do overwrite, because the final file is exactly the same size as the original file. That can make sense. But in SoX you can do so many things .... a trivial example if you take a file at 48KHz rate and make a new one at 96KHz the output file will be twice the size (ignoring the few bytes of headers). In such a case you cannot replace it 'pixel' by 'pixel'. Something like sox in.wav out wav whatever_effects; mv out.wav in.wav will 'overwrite', but you will need enough memory for both, and I'd far rather read any error messages and then do the replacement;-)> Michael ( "mv" is Linux, etc, for replace, no idea what it is for DOS (or whatever it is called these days), sorry.) ------------------------------------------------------------------------------ Come build with us! The BlackBerry(R) Developer Conference in SF, CA is the only developer event you need to attend this year. Jumpstart your developing skills, take BlackBerry mobile applications to market and stay ahead of the curve. Join us from November 9 - 12, 2009. Register now! http://p.sf.net/sfu/devconference _______________________________________________ Sox-users mailing list Sox-users@... https://lists.sourceforge.net/lists/listinfo/sox-users |
|
|
Re: Newbie Questions> From: chapman@... > To: sox-users@... > Date: Sun, 11 Oct 2009 15:51:25 +0000 > Subject: Re: [SoX-users] Newbie Questions > > On Sunday 11 October 2009 10:35 am, Michael Horvath wrote: > > I just started using Sox today and have a few questions. > > > > 1. Is there an option to overwrite the input file instead of specifying > > a new file? > > Firstly this is dangerous if there is a failure for some reason .... ! > > Secondly what is "overwrite"? > Some graphics applications do overwrite, because the final file is exactly > the same size as the original file. That can make sense. > But in SoX you can do so many things .... a trivial example if you take a > file at 48KHz rate and make a new one at 96KHz the output file will be twice > the size (ignoring the few bytes of headers). In such a case you cannot > replace it 'pixel' by 'pixel'. > > Something like > sox in.wav out wav whatever_effects; mv out.wav in.wav > will 'overwrite', > but you will need enough memory for both, > and > I'd far rather read any error messages and then do the replacement;-)> > > Michael > > ( "mv" is Linux, etc, for replace, no idea what it is for DOS (or whatever it > is called these days), sorry.) > > > ------------------------------------------------------------------------------ > Come build with us! The BlackBerry(R) Developer Conference in SF, CA > is the only developer event you need to attend this year. Jumpstart your > developing skills, take BlackBerry mobile applications to market and stay > ahead of the curve. Join us from November 9 - 12, 2009. Register now! > http://p.sf.net/sfu/devconference > _______________________________________________ > Sox-users mailing list > Sox-users@... > https://lists.sourceforge.net/lists/listinfo/sox-users Your E-mail and More On-the-Go. Get Windows Live Hotmail Free. Sign up now. ------------------------------------------------------------------------------ Come build with us! The BlackBerry(R) Developer Conference in SF, CA is the only developer event you need to attend this year. Jumpstart your developing skills, take BlackBerry mobile applications to market and stay ahead of the curve. Join us from November 9 - 12, 2009. Register now! http://p.sf.net/sfu/devconference _______________________________________________ Sox-users mailing list Sox-users@... https://lists.sourceforge.net/lists/listinfo/sox-users |
|
|
Re: Newbie QuestionsOn Sun, Oct 11, 2009 at 5:35 AM, Michael Horvath <mikh2161@...> wrote:
Hi! As already mention by others, there is no support for this. Since SoX is meant for command lines, its pretty easy to do this in a wrapper script.
I'm assuming your wanting to save some disk space? Or perhaps get some speed improvements from doing some work in parallel? See the "|" filename and -p option mentioned in sox man pages. Something like the following can get rid of the intermediate file but its still technically 2 command lines: sox -m "|sox FileA.mp3 -p loudness 10 channels 2" FileC.mp3 -C 0 FileD.mp3
------------------------------------------------------------------------------ Come build with us! The BlackBerry(R) Developer Conference in SF, CA is the only developer event you need to attend this year. Jumpstart your developing skills, take BlackBerry mobile applications to market and stay ahead of the curve. Join us from November 9 - 12, 2009. Register now! http://p.sf.net/sfu/devconference _______________________________________________ Sox-users mailing list Sox-users@... https://lists.sourceforge.net/lists/listinfo/sox-users |
|
|
Re: Newbie QuestionsOn 10/13/2009 1:05 PM, Chris Bagwell wrote:
> On Sun, Oct 11, 2009 at 5:35 AM, Michael Horvath<mikh2161@...> wrote: >> 1. Is there an option to overwrite the input file instead of specifying >> a new file? > > As already mention by others, there is no support for this. Since SoX is > meant for command lines, its pretty easy to do this in a wrapper script. OK. It's typical of console programs to support overwriting the input file though. ImageMagick is probably the best example of an extremely flexible command line app. >> 2. Is there a way to concatenate the following commands into a single >> command? >> >> sox.exe FileA.mp3 FileB.mp3 rate 44k loudness 10 channels 2 >> sox.exe -m FileB.mp3 FileC.mp3 -C 0 FileD.mp3 > > I'm assuming your wanting to save some disk space? Or perhaps get some > speed improvements from doing some work in parallel? See the "|" filename > and -p option mentioned in sox man pages. Something like the following can > get rid of the intermediate file but its still technically 2 command lines: > > sox -m "|sox FileA.mp3 -p loudness 10 channels 2" FileC.mp3 -C 0 FileD.mp3 Thanks! I will definitely be needing this. -Mike ------------------------------------------------------------------------------ Come build with us! The BlackBerry(R) Developer Conference in SF, CA is the only developer event you need to attend this year. Jumpstart your developing skills, take BlackBerry mobile applications to market and stay ahead of the curve. Join us from November 9 - 12, 2009. Register now! http://p.sf.net/sfu/devconference _______________________________________________ Sox-users mailing list Sox-users@... https://lists.sourceforge.net/lists/listinfo/sox-users |
|
|
Re: Newbie QuestionsOK. It's typical of console programs to support overwriting the input Actually, many console programs don't support overwriting the input file, especially not programs that repeatedly process a small amount of the input to create a small amount of the output. Image processing is usually done one image at a time. Since each file is one image, it makes sense to load the whole file into memory, make changes, and then overwrite the original file. SoX works on a few milliseconds of audio at a time, so your input file is still being used when SoX needs to write data to the output file and it doesn't make sense for SoX to overwrite the input file. Fox example, what happens when you want SoX to process a really long audio file, say 2 GB? SoX can't just load the whole file into memory like your image processor does for a single image file.
> sox -m "|sox FileA.mp3 -p loudness 10 channels 2" FileC.mp3 -C 0 FileD.mp3
Even more important than using only one command, the best part is that this creates the most accurate output file. Each time you create an MP3 file, you lose a little bit of accuracy. ------------------------------------------------------------------------------ Come build with us! The BlackBerry(R) Developer Conference in SF, CA is the only developer event you need to attend this year. Jumpstart your developing skills, take BlackBerry mobile applications to market and stay ahead of the curve. Join us from November 9 - 12, 2009. Register now! http://p.sf.net/sfu/devconference _______________________________________________ Sox-users mailing list Sox-users@... https://lists.sourceforge.net/lists/listinfo/sox-users |
|
|
Re: Newbie QuestionsOn 10/13/2009 7:33 PM, Doug Cook wrote:
> Actually, many console programs don't support overwriting the input file, > especially not programs that repeatedly process a small amount of the input > to create a small amount of the output. Image processing is usually done one > image at a time. Since each file is one image, it makes sense to load the > whole file into memory, make changes, and then overwrite the original file. > SoX works on a few milliseconds of audio at a time, so your input file is > still being used when SoX needs to write data to the output file and it > doesn't make sense for SoX to overwrite the input file. OK, whatever. I was just saying how I'd /like/ the program to work. It's not like it's a big deal that it doesn't. > Fox example, what > happens when you want SoX to process a really long audio file, say 2 GB? SoX > can't just load the whole file into memory like your image processor does > for a single image file. These are all barriers that were overcome long ago in the past. 2GB files have existed a lot longer than 2GB RAM slots. -Mike ------------------------------------------------------------------------------ Come build with us! The BlackBerry(R) Developer Conference in SF, CA is the only developer event you need to attend this year. Jumpstart your developing skills, take BlackBerry mobile applications to market and stay ahead of the curve. Join us from November 9 - 12, 2009. Register now! http://p.sf.net/sfu/devconference _______________________________________________ Sox-users mailing list Sox-users@... https://lists.sourceforge.net/lists/listinfo/sox-users |
| Free embeddable forum powered by Nabble | Forum Help |