Platform SDK: Web Telephony Engine |
An application can record a spoken message from the caller into a wave file. Recording a spoken message involves using the VOICEFILE attribute on either the TEXTAREA or INPUT TYPE=text element. When used with these elements, the VOICEFILE attribute specifies the name and location of the wave file in which the WTE is to record the caller's message.
The following example records a caller's message into a wave file called message.wav:
<P>Please leave your message now. When you are finished, press the pound key. <TEXTAREA VOICEFILE="message.wav"></TEXTAREA>
Note that in the previous example, the message.wav file is hard-coded and would be overwritten by each subsequent message. To prevent this, you could use scripting or an ActiveX control to generate unique file names for each caller at run time.
If the VOICEFILE attribute specifies the path to the wave file in Hypertext Transfer Protocol (HTTP) or Hypertext Transfer Protocol Secure (HTTPS), the file is uploaded to the given server and saved there in the specified location. The virtual directory in the server must have "write" permission.
The WTEApplication object includes several properties that control the duration of a recorded message. The RecordStopOnAnyKey property specifies a Boolean value that, if TRUE, causes recording to stop when the caller presses any DTMF key. If this property is FALSE, the caller can stop recording by pressing the string of DTMF keys specified in the InputTerminator property.
The MaxRecordTime property specifies the maximum duration of a spoken message. Recording automatically stops when the specified duration has elapsed. The RecordStopSilenceTime property specifies the period of silence that can elapse before recording automatically stops.
The InputWaveFormat property determines the format of the wave files in which recorded messages are stored.