voice icon indicating copy to clipboard operation
voice copied to clipboard

Sound playback briefly stops when calling Voice.start() on iOS

Open nicolasdeory opened this issue 3 years ago • 0 comments
trafficstars

I am using expo-av to play a long sound (~5s). At some point during the sound, I would like to call Voice.start() to start recognizing speech.

However, whenever I either call Voice.start() or Voice.stop(), all sound playback stops for about 0.5s - which is the time I assume it takes for the dictation engine to initialize.

The sound will resume shortly after Voice.onSpeechStart is called.

Is there any way to have Voice not cut audio playing at the same time?

I assume this might have to do with the iOS implementation of this package, that uses AVAudioSession and AVAudioSessionCategoryPlayAndRecord.

Unfortunately I'm not aware of the implementation details of the iOS media player or speech recognizer.

Could that be related to the issue?

nicolasdeory avatar Sep 06 '22 19:09 nicolasdeory