Video recording turns off when using speech to text Xamarin Forms

Alamzaib 1 Reputation point
2022-05-26T07:34:54.253+00:00

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;
        }
Not Monitored
Not Monitored
Tag not monitored by Microsoft.
38,827 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. YutongTie-MSFT 50,866 Reputation points
    2022-05-26T22:28:36.507+00:00

    Hello @Alamzaib

    Thanks for reaching out to us here. I am sorry XamarinCommunityToolkit is not supported in this form.

    But the engineering team is moderating bugs/question in below repo, please post your question there.

    https://github.com/xamarin/XamarinCommunityToolkit

    Hope this helps.

    Regards,
    Yutong

    -Please kindly accept the answer if you feel helpful to support the community, thanks.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.