I am creating an interview app in which the app is recording a video and the user is using speech to text at the same time. The issue is video recording gets interrupted when speech to text is active maybe it's because speech to text starts using the mic. I am using CameraView from Xamarin Community Toolkit to access camera. The speech to text is from Google built-in SDK. Do I need to open a separate thread or something?
Interview Page XAML:
Interview Page XAML:
<xct:CameraView
x:Name="xctCameraView"
CaptureMode="Photo"
CameraOptions="Front"
MediaCaptured="MediaCaptured"
HorizontalOptions="FillAndExpand"
VerticalOptions="FillAndExpand" />
Inter page CS:
xctCameraView.CaptureMode = CameraCaptureMode.Video;
xctCameraView.Shutter();
Speech to text in view model:
try
{
_speechRecongnitionInstance = DependencyService.Get<ISpeechToText>();
}
catch (Exception ex)
{
Answer = ex.Message;
}
MessagingCenter.Subscribe<ISpeechToText, string>(this, "STT", (sender, args) =>
{
SpeechToTextFinalResultReceived(args);
});
MessagingCenter.Subscribe<ISpeechToText>(this, "Final", (sender) =>
{
});
MessagingCenter.Subscribe<IMessageSender, string>(this, "STT", (sender, args) =>
{
SpeechToTextFinalResultReceived(args);
});
This is how I am starting speech to text:
try
{
_speechRecongnitionInstance.StartSpeechToText();
}
catch (Exception ex)
{
Answer = ex.Message;
}