Home › Forums › OpenEars plugins › Mixing with other audio.
Tagged: MixingWithOthers
- This topic has 5 replies, 2 voices, and was last updated 5 years, 1 month ago by Halle Winkler.
-
AuthorPosts
-
March 13, 2019 at 9:27 pm #1032732pleiroseiParticipant
Hello,
I’m having trouble mixing with other audio. Here is my scenario:
1. I’m playing music before app launches.
2. I launch app.
3. I login: upon login is when voice recognition beginsHere is the code I am running upon logging in:
//code
OEPocketsphinxController.sharedInstance().disableBluetooth = false
OEPocketsphinxController.sharedInstance().disableMixing = false
OEPocketsphinxController.sharedInstance().disablePreferredBufferSize = true
OEPocketsphinxController.sharedInstance().disablePreferredSampleRate = true
OEPocketsphinxController.sharedInstance().disablePreferredChannelNumber = true
OEPocketsphinxController.sharedInstance().secondsOfSilenceToDetect = 0.5
OEPocketsphinxController.sharedInstance()?.use8kMode = true
OEPocketsphinxController.sharedInstance().setLatencyTuning(4)try OEPocketsphinxController.sharedInstance()?.setActive(true)
OEPocketsphinxController.sharedInstance().startRealtimeListeningWithLanguageModel(atPath: lmPath, dictionaryAtPath: dicPath, acousticModelAtPath: OEAcousticModel.path(toModel: LocalLanguage.acousticModel))
//code
Am I calling these in the wrong order? Is the Rapid Ears: .startRealTimeLIsteningWithLangueModel function creating it’s own AVAudioSession that is overriding “disableMixing” being set to false? My bluetooth headphones are still able to work, so I assume it’s not overriding “disableBluetooth.” Trying to figure this out. Any help would be appreciated, thanks.
Also I have confirmed that calling setActive() on the PocketSphinx Controller does not interrupt the audio on an independent test (by which I mean afterwards I do not call the startRealTimeListening() function ).
If there is a work around to achieve the same thing, please let me know. The music is playing from a separate app, so I do not have access to the AVAudioPlayer for the sound (unless there is a sharedInstance of AVAudioPlayer that I’m not aware of.)
Thanks.
March 14, 2019 at 10:32 am #1032736Halle WinklerPolitepixWelcome,
Can you clarify the result you are seeking and what is actually happening?
March 14, 2019 at 1:20 pm #1032739pleiroseiParticipantYes:
The result I am seeking is the following:
1. Play music from any app, whether Apple Music app, Google Music, etc.
2. Launch app.
3. Login
4. Speech recognition is initiated.
5. Music continues to play while speech is recognized at the same time, without the music app being forced to pause or stop playing.What actually happens after #3:
4. Speech recognition is initiated.
5. Music fades out and is paused.
6. In order to play in the background, I have to manually hit play on whatever music app I was using after speech recognition is initialized.
7. Manually tap play on music app.
8. Now music will play while speech recognition is working.March 14, 2019 at 1:24 pm #1032740Halle WinklerPolitepixOK, thank you for the elaboration. This is the current expected behavior, sorry. The recognition is intended to be performed on a single audio input which is only mic speech, and PocketsphinxController performs its own audio session management to achieve this.
March 14, 2019 at 1:27 pm #1032741pleiroseiParticipantOkay. So then what is the point of the .dsableMixing property? Does it then essentially do nothing? I’m guessing that would explain why setting it to false doesn’t change the result?
March 14, 2019 at 1:37 pm #1032742Halle WinklerPolitepixSure, it’s in the API definition – it is for use while recognition isn’t in progress, if PocketsphinxController is usually doing something undesired to your session while recognition isn’t in progress. While recognition is in progress, it is expected that PocketsphinxController always normalizes to the session settings it is designed around.
-
AuthorPosts
- You must be logged in to reply to this topic.