iOS does not recognize the first word after calling the .listen() for second time and further, i.e. listen (all good here) -> stop -> listen (missed first word) -> stop -> etc...
If I benchmark the time from try self.audioEngine.start() to the first buffer received in the callback of inputNode?.installTap, there is approx. 175ms, which is sufficient to catch the first word. However on the second+ call to listenForSpeech, the same benchmark results in approx. 850ms, which is more than enough to miss the first word.
After experimenting a bit, I noticed that instantiating a new audioEngine and of course inputNode fixes this issue and we are back on cirka 175ms before receiving the first buffer on second+ calls.
iOS does not recognize the first word after calling the .listen() for second time and further, i.e. listen (all good here) -> stop -> listen (missed first word) -> stop -> etc...
If I benchmark the time from try self.audioEngine.start() to the first buffer received in the callback of inputNode?.installTap, there is approx. 175ms, which is sufficient to catch the first word. However on the second+ call to listenForSpeech, the same benchmark results in approx. 850ms, which is more than enough to miss the first word.
After experimenting a bit, I noticed that instantiating a new audioEngine and of course inputNode fixes this issue and we are back on cirka 175ms before receiving the first buffer on second+ calls.