Forum Replies Created
-
AuthorPosts
-
kelvinParticipant
I’ve added #import to my view controller.
And when i input this
[AudioSessionManager sharedAudioSessionManager].soundMixing = TRUE;the error shows
Property ‘soundMixing’ not found on object of type ‘id’so i did this instead
[[AudioSessionManager sharedAudioSessionManager]setSoundMixing:YES];and added this for vibration
AudioServicesPlayAlertSound(kSystemSoundID_Vibrate);
to – (void) fliteDidFinishSpeakingbut it didn’t vibrate on the device.
kelvinParticipantOk got it. Thanks alot for ur help.
Another question is that we can’t vibrate the phone during the sound playback right? I’ve have read some of ur previous post regarding this topic and you mention [AudioSessionManager sharedAudioSessionManager].soundMixing = TRUE; Where do i add this code? Do i need to modify the framework? Any other addition steps?
kelvinParticipantI guess my problem would be after flite has finished speaking, i suspended recognition and wait for 5 sec before audio is played but during that time audioPlayerDidFinishPlaying would have been flagged with a “YES” and resumed recognition. So i guess i would have to find a way to stop recognition for 5 sec.
kelvinParticipantI have tried suspending the recognition after flite finished speaking and after a delay of 5 seconds before playing a sound file but it seems that pocketsphinx did detect the sound file which is not what i wanted. Following are my functions for your reference.
– (void) fliteDidFinishSpeaking {
[self.pocketsphinxController suspendRecognition];
[self performSelector:@selector(playAudioAlert:) withObject:nil afterDelay:5.0f];
}-(void) playAudioAlert{
self.player = [[AVAudioPlayer alloc] initWithContentsOfURL:
[NSURL fileURLWithPath:[[NSBundle mainBundle]
pathForResource:@”Audio1″ ofType:@”wav”]] error:nil];player.delegate = self;
[self.player play];
}-(void) audioPlayerDidFinishPlaying:(AVAudioPlayer *)player successfully:(BOOL)flag{
if(flag == YES){
[self.pocketsphinxController resumeRecognition];
}
}kelvinParticipantNoted…
kelvinParticipantIt’s only appearing in the simulator. Device works well.
kelvinParticipantIt’s the unchanged downloaded straight from the web.
kelvinParticipantThanks for the advice. Got it to work in the IBAction with [self.fliteController.audioPlayer setVolume:volumeSlider.value];
kelvinParticipantok… thanks for the update
kelvinParticipantOk. Thanks for all the advice that you have provided.
kelvinParticipantThanks for the prompt reply. Any idea how the recognitionScore are being generated as in the formulae in it?
No problem returning n-best.
-
AuthorPosts