HAW_voicerecorder Class Reference

List of all members.

Public Member Functions

 HAW_voicerecorder ($url, $label)
 set_voice_text ($text, $audio_src="")
 set_voice_noinput ($text, $audio_src="", $url="")
 make_beep ($beep_indicator)
 set_maxtime ($maxtime)
 set_finalsilence ($finalsilence)
 set_type ($type)

Detailed Description

This class provides a voice recorder in a HAW_deck object.

Voice recording is feature for voice browsers only (VoiceXML). The recorded voice input will be sent encrypted as multipart/form-data to some other url, which normally will be another PHP/HAWHAW script. Here you can store the received data as .wav file on your server, play it to the user, or do whatever you want. Saving of the received voice data is similar to normal PHP file upload handling.

Voice recording is a very powerful feature which offers many oportunities to create high-sophisticated voice applications.


$myRecorder = new HAW_voicerecorder("http://www.foo.com/script.php", "Please speak after the tone");

$myRecorder = new HAW_voicerecorder("http://www.foo.com/script.php", "You have 2 minutes from now");

... and in http://www.foo.com/script.php we store the received wav file like this:
move_uploaded_file($_FILES['haw_recording']['tmp_name'], "/voice/message.wav");

See also:

Member Function Documentation

HAW_voicerecorder::HAW_voicerecorder ( url,


url Address where the recorded file is sent to.
label Some introducing words before the recording starts.

HAW_voicerecorder::set_voice_text ( text,
audio_src = "" 

Sets text to be spoken by voice browsers.

text Some alternative text that replaces <label>.
audio_src Some audio file (e.g. *.wav file) to play (optional).

HAW_voicerecorder::set_voice_noinput ( text,
audio_src = "",
url = "" 

Sets noinput text for voice browsers.

text Some text to inform the user that no input has been received.
audio_src Some audio file (e.g. *.wav file) to play (optional).
url Some other voice deck to go to (optional).

HAW_voicerecorder::make_beep ( beep_indicator  ) 

Activates/deactivates beep before recording starts.

beep_indicator,: true (default) or false.

HAW_voicerecorder::set_maxtime ( maxtime  ) 

Sets maximum duration of recording.

maxtime Duration of record in seconds

HAW_voicerecorder::set_finalsilence ( finalsilence  ) 

Sets interval of silence that indicates end of speech.

finalsilence Silence duration (in seconds)

HAW_voicerecorder::set_type ( type  ) 

Sets media format of recording.

type e.g. "audio/x-wav"

The documentation for this class was generated from the following file:
Generated on Mon Dec 6 21:51:55 2010 for HAWHAW PHP by  doxygen 1.5.1