You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
sems/apps/examples/ivr_examples/tmpfile.py

30 lines
497 B

#
# using IvrAudioFile fpopen
#
from log import *
from ivr import *
import os
class IvrDialog(IvrDialogBase):
def onSessionStart(self):
info("starting tmpfile.py")
f = open("/tmp/default_en.wav")
audio = f.read()
fp = os.tmpfile()
fp.write(audio)
fp.seek(0)
self.wav = IvrAudioFile()
self.wav.fpopen("tmp.wav", AUDIO_READ, fp)
self.enqueue(self.wav, None)
return
def onEmptyQueue(self):
if not self.queueIsEmpty():
return
self.bye()
self.stopSession()
return