play sound in pocketsphinxDidStartListening – Politepix /forums/topic/play-sound-in-pocketsphinxdidstartlistening/feed/ Tue, 23 Apr 2024 15:05:11 +0000 https://bbpress.org/?v=2.6.9 en-US /forums/topic/play-sound-in-pocketsphinxdidstartlistening/#post-1021609 <![CDATA[play sound in pocketsphinxDidStartListening]]> /forums/topic/play-sound-in-pocketsphinxdidstartlistening/#post-1021609 Mon, 09 Jun 2014 16:24:56 +0000 tbreslow 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!

]]>
/forums/topic/play-sound-in-pocketsphinxdidstartlistening/#post-1021610 <![CDATA[Reply To: play sound in pocketsphinxDidStartListening]]> /forums/topic/play-sound-in-pocketsphinxdidstartlistening/#post-1021610 Mon, 09 Jun 2014 16:44:07 +0000 Halle Winkler 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.

]]>
/forums/topic/play-sound-in-pocketsphinxdidstartlistening/#post-1021612 <![CDATA[Reply To: play sound in pocketsphinxDidStartListening]]> /forums/topic/play-sound-in-pocketsphinxdidstartlistening/#post-1021612 Mon, 09 Jun 2014 18:17:44 +0000 tbreslow Many thanks, got it! (And I’m a bit embarrassed that it was so easy).

]]>
/forums/topic/play-sound-in-pocketsphinxdidstartlistening/#post-1021613 <![CDATA[Reply To: play sound in pocketsphinxDidStartListening]]> /forums/topic/play-sound-in-pocketsphinxdidstartlistening/#post-1021613 Mon, 09 Jun 2014 18:21:17 +0000 Halle Winkler No worries, it’s a little counter-intuitive.

]]>
This XML file does not appear to have any style information associated with it. The document tree is shown below.
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0">
<channel>
<title>play sound in pocketsphinxDidStartListening – Politepix</title>
<atom:link href="/forums/topic/play-sound-in-pocketsphinxdidstartlistening/feed/" rel="self" type="application/rss+xml"/>
<link>/forums/topic/play-sound-in-pocketsphinxdidstartlistening/feed/</link>
<description/>
<lastBuildDate>Tue, 23 Apr 2024 15:05:11 +0000</lastBuildDate>
<generator>https://bbpress.org/?v=2.6.9</generator>
<language>en-US</language>
<item>
<guid>/forums/topic/play-sound-in-pocketsphinxdidstartlistening/#post-1021609</guid>
<title>
<![CDATA[ play sound in pocketsphinxDidStartListening ]]>
</title>
<link>/forums/topic/play-sound-in-pocketsphinxdidstartlistening/#post-1021609</link>
<pubDate>Mon, 09 Jun 2014 16:24:56 +0000</pubDate>
<dc:creator>tbreslow</dc:creator>
<description>
<![CDATA[ <p>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 <code>-(void) pocketsphinxDidStartListening</code></p> <pre><code> NSString *path = [[NSBundle mainBundle] pathForResource :kind ofType:@&quot;wav&quot;]; NSURL *pathURL = [NSURL fileURLWithPath:path]; AudioServicesCreateSystemSoundID((CFURLRef) CFBridgingRetain(pathURL), &amp;audioEffect); AudioServicesPlaySystemSound(audioEffect);</code></pre> <p>Nothing happens. What is the accepted technique for playing a sound once pocketsphinx has started to listen?</p> <p>Many Thanks!</p> ]]>
</description>
</item>
<item>
<guid>/forums/topic/play-sound-in-pocketsphinxdidstartlistening/#post-1021610</guid>
<title>
<![CDATA[ Reply To: play sound in pocketsphinxDidStartListening ]]>
</title>
<link>/forums/topic/play-sound-in-pocketsphinxdidstartlistening/#post-1021610</link>
<pubDate>Mon, 09 Jun 2014 16:44:07 +0000</pubDate>
<dc:creator>Halle Winkler</dc:creator>
<description>
<![CDATA[ <p>Hello,</p> <p>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.</p> ]]>
</description>
</item>
<item>
<guid>/forums/topic/play-sound-in-pocketsphinxdidstartlistening/#post-1021612</guid>
<title>
<![CDATA[ Reply To: play sound in pocketsphinxDidStartListening ]]>
</title>
<link>/forums/topic/play-sound-in-pocketsphinxdidstartlistening/#post-1021612</link>
<pubDate>Mon, 09 Jun 2014 18:17:44 +0000</pubDate>
<dc:creator>tbreslow</dc:creator>
<description>
<![CDATA[ <p>Many thanks, got it! (And I&#8217;m a bit embarrassed that it was so easy).</p> ]]>
</description>
</item>
<item>
<guid>/forums/topic/play-sound-in-pocketsphinxdidstartlistening/#post-1021613</guid>
<title>
<![CDATA[ Reply To: play sound in pocketsphinxDidStartListening ]]>
</title>
<link>/forums/topic/play-sound-in-pocketsphinxdidstartlistening/#post-1021613</link>
<pubDate>Mon, 09 Jun 2014 18:21:17 +0000</pubDate>
<dc:creator>Halle Winkler</dc:creator>
<description>
<![CDATA[ <p>No worries, it&#8217;s a little counter-intuitive.</p> ]]>
</description>
</item>
</channel>
</rss>