views:

307

answers:

2

Is it possible to use the NSSpeechRecognizer with an pre-recorded audio file instead of direct microphone input?

Or is there any other speech-to-text framework for Objective-C/Cocoa available?

Added:

Rather than using voice at the machine that is running the application external devices (e.g. iPhone) could be used for sending just an recorded audio stream to that desktop application. The desktop Cocoa app then would process and do whatever it's supposed to do using the assigned commands.

Thanks.

+1  A: 

I don't see any obvious way to switch the input programmatically, though the "Speech" companion guide's first paragraph in the "Recognizing Speech" section seems to imply other inputs can be used. I think this is meant to be set via System Preferences, though. I'm guessing it uses the primary audio input device selected there.

I suspect, though, you're looking for open-ended speech recognition, which NSSpeechRecognizer is not. If you're looking to transform any pre-recorded audio into text (ie, make a transcript of a recording), you're completely out of luck with NSSpeechRecognizer, as you must give it an array of "commands" to listen for.

Theoretically, you could feed it the whole dictionary, but I don't think that would work since you usually have to give it clear, distinct commands. Its performance would suffer, I would guess, if you gave it a bunch of stuff to analyze for (in real time).

Your best bet is to look at third-party open source solutions. There are a few generalized packages out there (none specifically for Cocoa/Objective-C), but this poses another question: What kind of recognition are you looking for? The two main forms of speech recognition ('trained' is more accurate but less flexible for different voices and the recording environment, whereas 'open' is generally much less accurate).

It'd probably be best if you stated exactly what you're trying to accomplish.

Joshua Nozzi
Thanks for that. After having a look into the NSSpeechRecognizer that works rather good at least for English to using voice to control the app I was thinking about having an iPhone application that records sound. This applications sends the sound to a desktop Cocoa app that processes and do whatever it's supposed to, depending on the commands that have been preset.
ck
A: 

can anyone help me about how to add audio to an already recorded audio file, ie i want to append some audio to the file that was already recorded.

Thank you

Akhil
That has absolutely nothing to do with this question. You should post it as a separate question.
Peter Hosey