libsphinxad implementation in vocalkit

14 views
Skip to first unread message

Samuel Kitono

unread,
Jul 18, 2010, 5:14:50 AM7/18/10
to VocalKit
Hi Brian,

I am interested in implementing the feature of recognizing voice
without the use of button. From what I gather from this forum you
would have to implement libsphinxad and iPhone's volume recognition.

I am just wonder if you can share some your knowledge or design in
implementing this and hopefully I can assist in implementing this
feature as well.

Samuel Kitono

unread,
Jul 18, 2010, 10:10:23 PM7/18/10
to VocalKit


No reply yet?
Well to show that I'm serious about this I have modified my vocalkit
to do change of volume detection. this is the NSLog from my vocalkit
<code>
2010-07-19 09:00:15.570 VocalKitTest[335:207] peakPower is -37.322300
and averagePower is -53.215462
2010-07-19 09:00:15.770 VocalKitTest[335:207] peakPower is -37.322300
and averagePower is -57.571228
2010-07-19 09:00:15.970 VocalKitTest[335:207] peakPower is -37.322300
and averagePower is -60.282143
2010-07-19 09:00:16.170 VocalKitTest[335:207] peakPower is -10.846441
and averagePower is -16.985174
2010-07-19 09:00:16.370 VocalKitTest[335:207] peakPower is -10.846441
and averagePower is -22.252283
2010-07-19 09:00:16.570 VocalKitTest[335:207] peakPower is -4.084096
and averagePower is -13.010586
2010-07-19 09:00:16.770 VocalKitTest[335:207] peakPower is -4.084096
and averagePower is -21.709961
2010-07-19 09:00:16.887 VocalKitTest[335:b42f] the utterance sample
number is 8000
2010-07-19 09:00:16.970 VocalKitTest[335:207] peakPower is -4.084096
and averagePower is -17.604145
2010-07-19 09:00:17.170 VocalKitTest[335:207] peakPower is -4.084096
and averagePower is -19.517765
2010-07-19 09:00:17.370 VocalKitTest[335:207] peakPower is -5.200096
and averagePower is -19.211012
2010-07-19 09:00:17.570 VocalKitTest[335:207] peakPower is -9.937097
and averagePower is -21.821417
2010-07-19 09:00:17.770 VocalKitTest[335:207] peakPower is -14.953096
and averagePower is -31.281145
2010-07-19 09:00:17.909 VocalKitTest[335:b42f] the utterance sample
number is 8000
2010-07-19 09:00:17.970 VocalKitTest[335:207] peakPower is -19.690096
and averagePower is -35.513420
2010-07-19 09:00:18.121 VocalKitTest[335:b42f] the utterance sample
number is 2401
INFO: cmn_prior.c(121): cmn_prior_update: from < 45.66 -5.59 -1.62
-2.39 -0.71 -1.08 -0.90 -0.26 -0.59 0.20 -0.27 -0.18 -0.05 >
INFO: cmn_prior.c(139): cmn_prior_update: to < 46.40 -5.31 -1.66
-2.52 -0.85 -1.00 -0.91 -0.26 -0.57 0.15 -0.29 -0.16 -0.05 >
INFO: fsg_search.c(1015): 229 frames, 5017 HMMs (21/fr), 11457 senones
(50/fr), 5705 history entries (24/fr)

INFO: fsg_search.c(1380): Start node <sil>.0:2:77
INFO: fsg_search.c(1419): End node <sil>.221:223:228 (-951480)
INFO: fsg_search.c(1419): End node friend.180:201:228 (-3614338)
INFO: fsg_search.c(1635): lattice start node <sil>.0 end node </s>.229
INFO: ps_lattice.c(1228): Normalizer P(O) = alpha(</s>:229:229) =
-1430446
INFO: ps_lattice.c(1266): Joint P(O,S) = -1430446 P(S|O) = 0
2010-07-19 09:00:18.166 VocalKitTest[335:207] M=welcome friend
</code>

as you can see the decibel peak power changes tremendously when there
is voice. So i just plan to pass the audio buffer whenever it detects
changes to cont_ad_read to filter out any silences of the audio file.
Which is then passed again to ps_process_raw and you know the rest...

So what do you think? Will it work?

Brian King

unread,
Jul 19, 2010, 6:23:25 PM7/19/10
to voca...@googlegroups.com
Hey Samuel,
Looks good! Sorry for the late reply, I've been failing at my
multi-tasking the last few days.

I'd start an utterance when the volume goes above a certain threshold.
Then stop the utterance when it goes below that threshold. Once the
threshold is dropped, I'd do a 'perform on main thread' or spawn a
new thread to do the computation. There may be a few corner cases to
think of, but if you attempt to do anything CPU intensive in a core
audio callback it will die rather un-gracefully.

Again, sorry for the slow response. Thanks for your help!

Brian

> --
> You received this message because you are subscribed to the Google Groups "VocalKit" group.
> To post to this group, send email to voca...@googlegroups.com.
> To unsubscribe from this group, send email to vocalkit+u...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/vocalkit?hl=en.
>
>

Samuel Kitono

unread,
Jul 20, 2010, 9:48:50 AM7/20/10
to VocalKit
Hey Brian,

What I plan to do is actually imitate some of the code of
pocketsphinx_continuous where it actually does not accept any audio
input when it was doing the computation so there is no need for multi-
threading... So actually I'm wondering why you have multi-thread to do
the computation... is it for partial parsing of the utterance?

Samuel Kitono

unread,
Jul 27, 2010, 8:38:30 AM7/27/10
to VocalKit
Right, I just encountered a problem with cont_ad. It is a linking
problem error. I will try to tweak here and there but it wont hurt to
ask for as well here. So this is the problem:

Undefined symbols:
"_cont_ad_init", referenced from:
-[VKPocketSphinxDecoder ps] in
libVocalKit.a(VKPocketSphinxDecoder.o)
"_cont_ad_calib", referenced from:
-[VKPocketSphinxDecoder ps] in
libVocalKit.a(VKPocketSphinxDecoder.o)
ld: symbol(s) not found
collect2: ld returned 1 exit status

Will really appreciate any advise or help here.

Samuel Kitono

unread,
Jul 27, 2010, 8:40:27 AM7/27/10
to VocalKit
Hey Brian, I have encountered a problem here regarding cont_ad. It
seems to be a linking problem, I will try to teak things on my end to
solve this but it wont hurt to ask here anyway. So this is the build
log (the problem):

Undefined symbols:
"_cont_ad_init", referenced from:
-[VKPocketSphinxDecoder ps] in
libVocalKit.a(VKPocketSphinxDecoder.o)
"_cont_ad_calib", referenced from:
-[VKPocketSphinxDecoder ps] in
libVocalKit.a(VKPocketSphinxDecoder.o)
ld: symbol(s) not found
collect2: ld returned 1 exit status

Will appreciate anyone who can help on this.

Samuel Kitono

unread,
Jul 27, 2010, 8:48:38 AM7/27/10
to VocalKit
Woops sorry about the spam somehow my google account somehow doesnt
register the updates of the message board and I figure I have to post
more. Really sorry about the trouble.
Reply all
Reply to author
Forward
0 new messages