- This topic has 8 replies, 2 voices, and was last updated 11 years, 7 months ago by NebulaFox.
-
AuthorPosts
-
September 3, 2012 at 6:16 pm #10924NebulaFoxParticipant
I am using AVFoundation to record audio and video into a mp4 file and displaying the preview using AVCapturePreviewLayer.
If I start PocketsphinxController listening before I tell AVCaptureSession to start running, the OpenEarsLogging shows it is not detecting any sound.
=STARTLOG
The audio session has never been initialized so we will do that now.
Checking and resetting all audio session settings.
audioCategory is incorrect, we will change it.
audioCategory is now on the correct setting of kAudioSessionCategory_PlayAndRecord.
bluetoothInput is incorrect, we will change it.
bluetooth input is now on the correct setting of 1.
categoryDefaultToSpeaker is incorrect, we will change it.
CategoryDefaultToSpeaker is now on the correct setting of 1.
preferredBufferSize is incorrect, we will change it.
PreferredBufferSize is now on the correct setting of 0.128000.
preferredSampleRateCheck is incorrect, we will change it.
preferred hardware sample rate is now on the correct setting of 16000.000000.
AudioSessionManager startAudioSession has reached the end of the initialization.
Exiting startAudioSession.
…
Recognition loop has started
…
Starting openAudioDevice on the device.
Audio unit wrapper successfully created.
Set audio route to SpeakerAndMicrophone
Checking and resetting all audio session settings.
audioCategory is correct, we will leave it as it is.
bluetoothInput is correct, we will leave it as it is.
categoryDefaultToSpeaker is correct, we will leave it as it is.
preferredBufferSize is correct, we will leave it as it is.
preferredSampleRateCheck is correct, we will leave it as it is.
Setting the variables for the device and starting it.
Looping through ringbuffer sections and pre-allocating them.
…
Started audio output unit.
Calibration has started
…
The Audio Session was interrupted.
Calibration has completed
Project has these words in its dictionary:
RECORD
RECORD(2)
RECORD(3)
SNAP
STOPListening.
…
Audio route has changed for the following reason:
There has been a change of category
The previous audio route was SpeakerAndMicrophone
This is not a case in which OpenEars performs a route change voluntarily. At the close of this function, the audio route is SpeakerAndMicrophone
Audio route has changed for the following reason:
There has been a change of category
The previous audio route was Speaker
This is not a case in which OpenEars performs a route change voluntarily. At the close of this function, the audio route is SpeakerAndMicrophone
=ENDLOGIf I start PocketsphinxController listening after I tell AVCaptureSession to start running then OpenEarsLogging shows it is detecting audio but the AVCaptureLayer displaying the feed from AVCaptureSession is frozen.
How can I get it so that I can get PocketsphinxController listening and still have AVCaptureSession showing input via AVCaptureSession.
September 3, 2012 at 6:31 pm #10926Halle WinklerPolitepixAre you capturing audio at the same time as you are trying to do speech recognition?
September 3, 2012 at 7:39 pm #10936NebulaFoxParticipantI connect the audio input to the AVCaptureSession initially and this is the point I get to while I have been testing. I do hope that it is possible to somehow use speech recognition while capturing audio.
September 3, 2012 at 7:44 pm #10937Halle WinklerPolitepixThere’s only one audio stream, it can’t be streamed into two objects simultaneously.
September 3, 2012 at 7:48 pm #10938NebulaFoxParticipantIs there away to copy the one audio stream and that can be sent to multiple objects?
September 3, 2012 at 7:50 pm #10939Halle WinklerPolitepixI don’t think that is going to be trivial. I’m sure it is in some way possible but I doubt it can be done while enjoying any of the convenience functions of AVCaptureSession or AudioSessionManager/ContinuousAudioUnit. It’s unfortunately outside of the scope of the support I can give here.
September 3, 2012 at 7:57 pm #10940NebulaFoxParticipantThat is true. Although, through AVCaptureSession I have a CMSampleBuffer that should contain an audio sample. It is a shame that can not some how be used.
September 3, 2012 at 8:04 pm #10941Halle WinklerPolitepixYou could try keeping your sample buffers and writing them out to a WAV file and submitting the WAV file to the runRecognitionOnWavFileAtPath: method. You won’t get voice audio detection/continuous recognition but you can submit the speech at the end of the capture.
September 3, 2012 at 8:07 pm #10942NebulaFoxParticipantOww… I will try that
-
AuthorPosts
- You must be logged in to reply to this topic.