Page 1 of 1

sox.exe clips audio file while conversion

Posted: Wed Jun 03, 2009 7:15 am
by sdstuder
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.

Suggestions to streamline the IVR code

Posted: Wed Jun 03, 2009 9:48 am
by support
The IVR issue lies in differences between the C# configuration on NT versus XP. Unfortunately we have no way to directly test that as we are not a Microsoft shop here. However, we can provide a few suggestions for you to at least streamline the IVR code. First, have you checked whether testoutput.raw, as produced on your NT box versus your XP box, matches? Second, have you reviewed and compared the configuration of C# on those two systems? Third, have you tried combining the two sox commands into a single command like this:

sox test.wav -t wav -r 8000 -1 -U testoutput.wav

sox.exe clips audio file while conversion

Posted: Fri Jun 12, 2009 6:31 am
by sdstuder
hi all,

i found the solution. actually, problem was with Process that we are creating. Actually, what was happening is that 2nd process is working on output of first process. So, 2nd process was getting started before termination of first process due to which 2nd process was working on half output of first process. Hence, output audio file is getting clipped.

Thanking you.