|
HAWHAW PHP |
|||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
HAW_voicerecorder
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.
Examples:
$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");
$myRecorder->make_beep(false);
$myRecorder->set_maxtime(120);
// ... 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");
HAW_deck
Constructor Summary | |
HAW_voicerecorder(var $url,
var $label)
Constructor |
Method Summary | |
void |
make_beep(var $beep_indicator)
Activates/deactivates beep before recording starts. |
void |
set_finalsilence(var $finalsilence)
Sets interval of silence that indicates end of speech. |
void |
set_maxtime(var $maxtime)
Sets maximum duration of recording. |
void |
set_type(var $type)
Sets media format of recording. |
void |
set_voice_noinput(var $text,
var $audio_src,
var $url)
Sets noinput text for voice browsers. |
void |
set_voice_text(var $text,
var $audio_src)
Sets text to be spoken by voice browsers. |
Constructor Detail |
public HAW_voicerecorder(var $url, var $label)
url
- Address where the recorded file is sent to.label
- Some introducing words before the recording starts.Method Detail |
public void set_voice_text(var $text, var $audio_src)
text
- Some alternative text that replaces <label>.audio_src
- Some audio file (e.g. *.wav file) to play (optional).public void set_voice_noinput(var $text, var $audio_src, var $url)
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).public void make_beep(var $beep_indicator)
beep_indicator:
- true (default) or false.public void set_maxtime(var $maxtime)
maxtime
- Duration of record in secondspublic void set_finalsilence(var $finalsilence)
finalsilence
- Silence duration (in seconds)public void set_type(var $type)
type
- e.g. "audio/x-wav"
|
© Norbert Huffschmid assembled from PHP source using sed and javadoc |
|||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |