diff --git a/src/CommunityToolkit.Maui.Core/Essentials/SpeechToText/OfflineSpeechToTextImplementation.ios.cs b/src/CommunityToolkit.Maui.Core/Essentials/SpeechToText/OfflineSpeechToTextImplementation.ios.cs index c635058a2c..90306bfaf2 100644 --- a/src/CommunityToolkit.Maui.Core/Essentials/SpeechToText/OfflineSpeechToTextImplementation.ios.cs +++ b/src/CommunityToolkit.Maui.Core/Essentials/SpeechToText/OfflineSpeechToTextImplementation.ios.cs @@ -35,11 +35,7 @@ async Task InternalStartListening(SpeechToTextOptions options, CancellationToken var node = audioEngine.InputNode; var recordingFormat = node.GetBusOutputFormat(audioEngineBusTap); - node.InstallTapOnBus(audioEngineBusTap, 1024, recordingFormat, (buffer, _) => - { - liveSpeechRequest.Append(buffer); - RestartTimer(); - }); + node.InstallTapOnBus(audioEngineBusTap, 1024, recordingFormat, (buffer, _) => liveSpeechRequest.Append(buffer)); audioEngine.Prepare(); audioEngine.StartAndReturnError(out var error); diff --git a/src/CommunityToolkit.Maui.Core/Essentials/SpeechToText/OfflineSpeechToTextImplementation.macos.cs b/src/CommunityToolkit.Maui.Core/Essentials/SpeechToText/OfflineSpeechToTextImplementation.macos.cs index b1251cd3e8..0177bba991 100644 --- a/src/CommunityToolkit.Maui.Core/Essentials/SpeechToText/OfflineSpeechToTextImplementation.macos.cs +++ b/src/CommunityToolkit.Maui.Core/Essentials/SpeechToText/OfflineSpeechToTextImplementation.macos.cs @@ -44,11 +44,7 @@ async Task InternalStartListening(SpeechToTextOptions options, CancellationToken var node = audioEngine.InputNode; var recordingFormat = node.GetBusOutputFormat(audioEngineBusTap); - node.InstallTapOnBus(audioEngineBusTap, 1024, recordingFormat, (buffer, _) => - { - liveSpeechRequest.Append(buffer); - RestartTimer(); - }); + node.InstallTapOnBus(audioEngineBusTap, 1024, recordingFormat, (buffer, _) => liveSpeechRequest.Append(buffer)); audioEngine.Prepare(); audioEngine.StartAndReturnError(out var error); diff --git a/src/CommunityToolkit.Maui.Core/Essentials/SpeechToText/SpeechToTextImplementation.ios.cs b/src/CommunityToolkit.Maui.Core/Essentials/SpeechToText/SpeechToTextImplementation.ios.cs index f13d283d5e..51d2b703ff 100644 --- a/src/CommunityToolkit.Maui.Core/Essentials/SpeechToText/SpeechToTextImplementation.ios.cs +++ b/src/CommunityToolkit.Maui.Core/Essentials/SpeechToText/SpeechToTextImplementation.ios.cs @@ -25,11 +25,7 @@ async Task InternalStartListeningAsync(SpeechToTextOptions options, Cancellation var node = audioEngine.InputNode; var recordingFormat = node.GetBusOutputFormat(audioEngineBusTap); - node.InstallTapOnBus(audioEngineBusTap, 1024, recordingFormat, (buffer, _) => - { - liveSpeechRequest.Append(buffer); - RestartTimer(); - }); + node.InstallTapOnBus(audioEngineBusTap, 1024, recordingFormat, (buffer, _) => liveSpeechRequest.Append(buffer)); audioEngine.Prepare(); audioEngine.StartAndReturnError(out var error); diff --git a/src/CommunityToolkit.Maui.Core/Essentials/SpeechToText/SpeechToTextImplementation.macos.cs b/src/CommunityToolkit.Maui.Core/Essentials/SpeechToText/SpeechToTextImplementation.macos.cs index d59a7e5aee..40bd34dc9a 100644 --- a/src/CommunityToolkit.Maui.Core/Essentials/SpeechToText/SpeechToTextImplementation.macos.cs +++ b/src/CommunityToolkit.Maui.Core/Essentials/SpeechToText/SpeechToTextImplementation.macos.cs @@ -41,12 +41,8 @@ async Task InternalStartListeningAsync(SpeechToTextOptions options, Cancellation } var node = audioEngine.InputNode; - var recordingFormat = node.GetBusOutputFormat(0); - node.InstallTapOnBus(audioEngineBusTap, 1024, recordingFormat, (buffer, _) => - { - liveSpeechRequest.Append(buffer); - RestartTimer(); - }); + var recordingFormat = node.GetBusOutputFormat(audioEngineBusTap); + node.InstallTapOnBus(audioEngineBusTap, 1024, recordingFormat, (buffer, _) => liveSpeechRequest.Append(buffer)); audioEngine.Prepare(); audioEngine.StartAndReturnError(out var error);