We've Moved! Please visit our new and improved forum over at our new portal: https://portal.plumvoice.com/hc/en-us/community/topics

sox.exe clips audio file while conversion

Questions and answers about IVR programming for Plum DEV

Moderators: admin, support

Post Reply
sdstuder
Posts: 16
Joined: Fri Mar 18, 2005 6:38 pm

sox.exe clips audio file while conversion

Post 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.

support
Posts: 3632
Joined: Mon Jun 02, 2003 3:47 pm
Location: Boston, MA
Contact:

Suggestions to streamline the IVR code

Post 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
Last edited by support on Tue Feb 16, 2010 1:12 pm, edited 2 times in total.

sdstuder
Posts: 16
Joined: Fri Mar 18, 2005 6:38 pm

sox.exe clips audio file while conversion

Post 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.

Post Reply