[Sems] queue audio files code example ?

Jeremy Ardley jeremy at ardley.org
Mon Sep 1 09:11:45 CEST 2008


Hello,

I'm attempting to play a file to a caller, then when it has finished, 
perform some processing and play another file to the  caller.

The examples I have seen use a standard way to initiate file play in 
startSession()
...

  if(wav_file.open(filename,AmAudioFile::Read))
  {
    ERROR("Couldn't open file %s.\n", filename.c_str());
    throw string("AnnDialog::onSessionStart: Cannot open file\n");
  }
  setOutput(&wav_file);

and later

void AnnDialog::process(AmEvent* event)
{
  AmAudioEvent* audio_event = dynamic_cast<AmAudioEvent*>(event);
  if(audio_event && (audio_event->event_id == AmAudioEvent::cleared))
  {
    DBG("AnnDialog::process: audio event received\n");
    dlg.bye();
    setStopped();
    return;
  }

  AmSession::process(event);
}


I think I need to modify the process function to start playing a new 
file instead of sending a bye to the dialog. However i can't find any 
obvious examples of how to do this, and my first pass of using a new 
setOutput in the process event doesn't work.

Any advice appreciated.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: jeremy.vcf
Type: text/x-vcard
Size: 242 bytes
Desc: not available
Url : http://lists.iptel.org/pipermail/sems/attachments/20080901/65497ebe/attachment.vcf 


More information about the Sems mailing list