play sound in pocketsphinxDidStartListening

Home Forums OpenEars play sound in pocketsphinxDidStartListening

Viewing 4 posts - 1 through 4 (of 4 total)

  • Author
    Posts
  • #1021609
    tbreslow
    Participant

    Hi, I have a use case where I would like to play a sound to let my users know that a task has completed and they can now use voice commands. I tried a very simple approach using the following in -(void) pocketsphinxDidStartListening

        NSString *path  = [[NSBundle mainBundle] pathForResource :kind ofType:@"wav"];
        NSURL *pathURL = [NSURL fileURLWithPath:path];
        AudioServicesCreateSystemSoundID((CFURLRef) CFBridgingRetain(pathURL), &audioEffect);
        AudioServicesPlaySystemSound(audioEffect);

    Nothing happens. What is the accepted technique for playing a sound once pocketsphinx has started to listen?

    Many Thanks!

    #1021610
    Halle Winkler
    Politepix

    Hello,

    Sure, this has to be done in a particular way due to a bug in the PlayAndRecord audio session type – just search these forums for AVAudioPlayer and you should get a bunch of hits about how it works.

    #1021612
    tbreslow
    Participant

    Many thanks, got it! (And I’m a bit embarrassed that it was so easy).

    #1021613
    Halle Winkler
    Politepix

    No worries, it’s a little counter-intuitive.

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.