Use self.wav. Juha Heinanen wrote:
while trying a debug an ivr problem, i started from a slightly modified apps/examples/ivr_examples/tmpfile.py:from log import * from ivr import * import os class IvrDialog(IvrDialogBase): def onSessionStart(self, hdrs): f = open("/tmp/default_en.wav") audio = f.read() fp = os.tmpfile() fp.write(audio) fp.seek(0) wav = IvrAudioFile() wav.fpopen("tmp.wav", AUDIO_READ, fp) self.enqueue(wav, None) however, when i run it, i get ... Dec 2 05:00:50 localhost sems[26208]: DEBUG: [b6219b90] IvrAudioFile_new (IvrAudio.cpp:17): ---------- IvrAudioFile_alloc ----------- Dec 2 05:00:50 localhost sems[26208]: DEBUG: [b6219b90] wav_read_header (wav_hdr.c:126): trying to read WAV file Dec 2 05:00:50 localhost sems[26208]: DEBUG: [b6219b90] wav_read_header (wav_hdr.c:129): tag = <RIFF> Dec 2 05:00:50 localhost sems[26208]: DEBUG: [b6219b90] wav_read_header (wav_hdr.c:137): file size = <13700> Dec 2 05:00:50 localhost sems[26208]: DEBUG: [b6219b90] wav_read_header (wav_hdr.c:140): tag = <WAVE> Dec 2 05:00:50 localhost sems[26208]: DEBUG: [b6219b90] wav_read_header (wav_hdr.c:147): tag = <fmt > Dec 2 05:00:50 localhost sems[26208]: DEBUG: [b6219b90] wav_read_header (wav_hdr.c:155): chunk_size = <16> Dec 2 05:00:50 localhost sems[26208]: DEBUG: [b6219b90] wav_read_header (wav_hdr.c:159): fmt = <01> Dec 2 05:00:50 localhost sems[26208]: DEBUG: [b6219b90] wav_read_header (wav_hdr.c:163): channels = <1> Dec 2 05:00:50 localhost sems[26208]: DEBUG: [b6219b90] wav_read_header (wav_hdr.c:167): rate = <8000> Dec 2 05:00:50 localhost sems[26208]: DEBUG: [b6219b90] wav_read_header (wav_hdr.c:174): bits/sample = <16> Dec 2 05:00:50 localhost sems[26208]: DEBUG: [b6219b90] wav_read_header (wav_hdr.c:195): tag = <data> Dec 2 05:00:50 localhost sems[26208]: DEBUG: [b6219b90] wav_read_header (wav_hdr.c:199): chunk size = <13664> Dec 2 05:00:50 localhost sems[26208]: DEBUG: [b6219b90] setBufferSize (AmBufferedAudio.cpp:61): set output buffer size to 0 low thresh 0, fill thresh 0 Dec 2 05:00:50 localhost sems[26208]: DEBUG: [b6219b90] IvrAudioFile_dealloc (IvrAudio.cpp:45): ---------- IvrAudioFile_dealloc ----------- Dec 2 05:00:50 localhost sems[26208]: DEBUG: [b6219b90] relayEvent (AmB2BSession.cpp:184): AmB2BSession::relayEvent: id= Dec 2 05:00:50 localhost sems[26208]: DEBUG: [b6219b90] run (AmSession.cpp:345): qodwoapvjmuj...@localhost dlg.getUACTransPending() = 0 Dec 2 05:00:50 localhost sems[26208]: DEBUG: [b6744b90] process (AmMediaProcessor.cpp:397): Session inserted to the scheduler Dec 2 05:00:50 localhost sems[26208]: WARNING: [b6744b90] calcBytesToRead (AmAudio.cpp:161): Cannot convert samples to bytes and the file is not played. has something changed in sems, since the example was written? -- juha _______________________________________________ Sems mailing list [email protected] http://lists.iptel.org/mailman/listinfo/sems
_______________________________________________ Sems mailing list [email protected] http://lists.iptel.org/mailman/listinfo/sems
