I’m trying to test OpenEars speech recognition using previously recorded WAV-files. I created a few 16-bit WAV-file and upload them to the music library. But now I can’t take such path to the file, that it is good for runRecognitionOnWavFileAtPath method. Is it possible to use that method for the files from music library? Did anybody try to do the same?
here is my code:
– (IBAction) searchAction
{
MPMediaPickerController *mediaPicker = [[MPMediaPickerController alloc] initWithMediaTypes:MPMediaTypeMusic];
mediaPicker.delegate = self;
mediaPicker.allowsPickingMultipleItems = NO;
[self presentViewController:mediaPicker animated:YES completion:nil];
}
– (void)mediaPicker: (MPMediaPickerController *)mediaPicker didPickMediaItems:(MPMediaItemCollection *)mediaItemCollection
{
[self dismissModalViewControllerAnimated:YES];
MPMediaItem *anItem = (MPMediaItem *)[mediaItemCollection.items objectAtIndex: 0];
NSURL *assetURL = [anItem valueForProperty: MPMediaItemPropertyAssetURL];
NSString* filePath = [assetURL absoluteString];
[self.pocketsphinxController runRecognitionOnWavFileAtPath:filePath usingLanguageModelAtPath:self.pathToFirstDynamicallyGeneratedLanguageModel dictionaryAtPath:self.pathToFirstDynamicallyGeneratedDictionary acousticModelAtPath:[AcousticModel pathToModel:@”AcousticModelEnglish”] languageModelIsJSGF:FALSE];
}
Thanks
]]>