Page 1 of 1

Saving recording to a file on the http server

Posted: Wed Apr 28, 2004 7:14 pm
by leftkost
How do you save a voice recording to a file on the server? Say to verify an order, or similar? Is it saved as a wav file?

IVR code for Saving recording to a file on the http server

Posted: Thu Apr 29, 2004 10:23 am
by support
Hello:

This question belongs in the VoiceXML Developer Q&A forum; this particular forum is meant for IVR platform setup/configuration issues.

In order to save a wav file, you need to do 2 things:
Step 1) use a <record> tag to record audio from a telephone call session. here is an IVR example of a record tag that does this:

Code: Select all

  <form id="record_audio"> 
   <record name="aud" beep="true" type="audio/basic" dtmfterm="true"
      maxtime="60.0s" finalsilence="2.0s">
      <prompt>
        <audio src="wav/record_instruction.wav">
          After the beep, please record a message. 
          To cancel the recording and start over, press the star key. 
        </audio>
      </prompt>
      <filled>
        <if cond="aud$.termchar == '*'">
          <clear/>
          <reprompt/>
       <else/>
          <assign name="myrecording" expr="aud"/>
          <goto next="#review_audio"/>
        </if>
      </filled>
      <catch event="noinput nomatch">
        <audio src="wav/didnthear.wav">Sorry, I didn't hear you.</audio>
        <reprompt />
      </catch>
   </record>  
</form>

Step 2) submit the wav data to a server side script that will read the wav file out of the HTTP POST data, and save it to disk on the web server locally. Here is an IVR example <submit> that posts the recorded file to a webserver:

Code: Select all

<submit next="http://www.samplehost.com/file_upload.php" 
		method="post" 
		enctype="multipart/form-data"
		namelist="myrecording"/> 
The IVR script located at http://www.samplehost.com/file_upload.php is now responsible for reading the audio data out of the POST variable and storing it to disk.


If you need more information, please clarify where you are having the problem and we will provide more assistance. Good luck!

sincerely,

The Plum Support Team