sox.exe clips audio file while conversion
Posted: Wed Jun 03, 2009 7:15 am
Hi all,
I m using sox.exe to convert any .wav file into another .wav file that should be compatible with my application.
here scenario is :
when i use sox.exe through command prompt to convert test .wav file of size say 130 KB with sampling rate 22.5KHZ,
it converts into testoutput.wav file of size 48KB with 8KHZ. I use following commands :
C:\>sox.exe test.wav -t raw -r 8000 -1 -U testoutput.raw
C;\>sox.exe -r 8000 -1 -U testoutput.raw -t wav -r 8000 -1 -U testoutput.wav
But, problem is when i run these command through my application code in C# in the way shown below :
System.Diagnostics.Process.Start(strSOXExePath+"sox.exe", " test.wav -t raw -r 8000 -1 -U testoutput.raw" );
System.Diagnostics.Process.Start(strSOXExePath+"sox.exe", " -r 8000 -1 -U testoutput.raw -t wav -r 8000 -1 -U testoutput.wav" );
Above 2 lines also creates testoutput.wav file but this wav file created from my application is of size 9KB only that is highly clipped and plays with half word only, doesn't play completely.
This problem is occuring on windows NT machine. But everything works well on window XP.
So, i'm not able to figure what is the difference here if i creates wav file through 1) command prompt and 2) my application code. I wanted same output (wav file of size 48 KB) from application also.
Please help me to figure out and guide me.
Thanking you.
I m using sox.exe to convert any .wav file into another .wav file that should be compatible with my application.
here scenario is :
when i use sox.exe through command prompt to convert test .wav file of size say 130 KB with sampling rate 22.5KHZ,
it converts into testoutput.wav file of size 48KB with 8KHZ. I use following commands :
C:\>sox.exe test.wav -t raw -r 8000 -1 -U testoutput.raw
C;\>sox.exe -r 8000 -1 -U testoutput.raw -t wav -r 8000 -1 -U testoutput.wav
But, problem is when i run these command through my application code in C# in the way shown below :
System.Diagnostics.Process.Start(strSOXExePath+"sox.exe", " test.wav -t raw -r 8000 -1 -U testoutput.raw" );
System.Diagnostics.Process.Start(strSOXExePath+"sox.exe", " -r 8000 -1 -U testoutput.raw -t wav -r 8000 -1 -U testoutput.wav" );
Above 2 lines also creates testoutput.wav file but this wav file created from my application is of size 9KB only that is highly clipped and plays with half word only, doesn't play completely.
This problem is occuring on windows NT machine. But everything works well on window XP.
So, i'm not able to figure what is the difference here if i creates wav file through 1) command prompt and 2) my application code. I wanted same output (wav file of size 48 KB) from application also.
Please help me to figure out and guide me.
Thanking you.