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

Sound conversion question.

Questions and answers about IVR programming for Plum DEV

Moderators: admin, support

Post Reply
jcanter
Posts: 47
Joined: Thu Jun 19, 2003 8:54 am

Sound conversion question.

Post by jcanter »

I am trying to use sox to convert from the raw file that the IVR platform records in to a wav format. This is how I am trying to do the conversion:

Code: Select all

sox -r 8000 -b -u -c 1 file.raw -t wav file.wav
The wav file that this generates is has horrible static. Does anyone know what I am doing wrong here?

jcanter
Posts: 47
Joined: Thu Jun 19, 2003 8:54 am

Post by jcanter »

Also, I found this in a FAQ:
You can use WAV files with these specifications:
- channels: mono
- sample rate: 8 kHz
- encoding: either 16 bit linear, 8 bit u-law, or a-law coding (.wav).

You can also use headerless audio files with 8 kHz, 8 bit u-law (.ul) or a-law (.al) encoding.

All of these formats can also be used for fetchaudio and transferaudio.

For more information, see <audio> in the Programmer's Reference Guide.[/url][/code]
However, when I try to play a file back that I have just recorded, I get this error:
Thu 19 Jun 2003 01:26:28 PM EDT (000002;015;1056034941) [prompt] ERROR: Unsupported file type of text/html; charset=iso-8859-1
in PVXpromptSourceURL constructor
Thu 19 Jun 2003 01:26:28 PM EDT (000002;015;1056034941) [prompt] EVENT: Created audio source object for wavs/dva/dva/5843.raw
Thu 19 Jun 2003 01:26:28 PM EDT (000002;015;1056034941) [prompt] ERROR: Unrecognized format in pvxPromptConvertCopySource
Thu 19 Jun 2003 01:26:28 PM EDT (000002;015;1056034941) [prompt] ERROR: Failure during pvxPromptConvertCopySource
Thu 19 Jun 2003 01:26:28 PM EDT (
I am assuming that the file I just recorded should be 8 bit u-law which, according to the FAQ, should allow the IVR to play back the file it just recorded.

jcanter
Posts: 47
Joined: Thu Jun 19, 2003 8:54 am

Post by jcanter »

Ok, I figured out how to convert the files with sox:
sox -r 8000 -b -U -c 1 file.raw -t wav -U -w -r 800 file.wav
However, I would still like to know about the IVR playing back headerless files.[/quote]

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

Playing recorded u-law audio files using the IVR platform

Post by support »

To play recorded audio files, the Plum Voice Platform first checks the MIME type of the source file returned by the IVR application server. If no MIME type is returned, then the IVR platform checks the file extension to infer the file format.

If you're having trouble playing back recorded 8 bit u-law header audio without converting to WAV, check the following:

1. Check that the path to your audio file is correct by browsing to the audio src URL using your web browser. The error message:

Code: Select all

Unsupported file type of text/html
often indicates an error message being returned by your IVR application server.

2. Check the MIME type returned by your application server using your web browser. Netscape Navigator will report usually report the type. Your IVR application server should be sending the file as MIME type audio/basic.

3. If you are unable to configure your application server to send the correct MIME type, then set the file extension to one of extensions mapped in your Plum IVR Platform configuration through the PlumVP admin UI or in the file plumvp.cfg. By default, the following extensions are mapped to type audio/basic:
  • .ul
    .ulaw
    .pcm
For a-law, use the MIME type audio/x-alaw-basic or the extensions .al or .alaw.
Last edited by support on Fri Feb 26, 2010 10:42 am, edited 4 times in total.

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

IVR developers at Plum use SoX for conversions

Post by support »

Here's what IVR developers at Plum use for converting 8 bit u-law headerless files to wav:

Code: Select all

sox -r 8000 -U -b -t raw recording.raw recording.wav
Last edited by support on Mon Jan 18, 2010 10:06 am, edited 1 time in total.

jcanter
Posts: 47
Joined: Thu Jun 19, 2003 8:54 am

Re: Playing recorded u-law audio files

Post by jcanter »

support wrote:To play recorded audio files, the Plum Voice Platform first checks the MIME type of the source file returned by the application server. If no MIME type is returned, then the platform checks the file extension to infer the file format.

If you're having trouble playing back recorded 8 bit u-law header audio without converting to WAV, check the following:

1. Check that the path to your audio file is correct by browsing to the audio src URL using your web browser. The error message:

Code: Select all

Unsupported file type of text/html
often indicates an error message being returned by your application server.

2. Check the MIME type returned by your application server using your web browser. Netscape Navigator will report usually report the type. Your application server should be sending the file as MIME type audio/basic.

3. If you are unable to configure your application server to send the correct MIME type, then set the file extension to one of extensions mapped in your Plum Voice Platform configuration through the PlumVP admin UI or in the file plumvp.cfg. By default, the following extensions are mapped to type audio/basic:
  • .ul
    .ulaw
    .pcm
For a-law, use the MIME type audio/x-alaw-basic or the extensions .al or .alaw.
My application was returning files with the .ul and .ulaw extension with the mime type of text/html. However, placing the .ul or .ulaw extensions on the files I was trying to play did not correct the issue. I checked the plumvp.cfg and these files were mapped to play as audio/basic in that file. I was able to get this working by editing /usr/local/apache/conf/mime.types and adding the .ul and .ulaw extensions as audio/basic mime types.

Post Reply