Forum Cross Platform with Xamarin

CrossTextToSpeech sound issue

I have created a .NET 2017 solution to start a Text To Speech app. I have followed online instructions and seems really simple, I added the TextToSpeech plugin version 3.0.1 to the solution and added the following code to the MainPage of the Portable Project:

MainPage.xaml

<ContentPage.Content>
    <StackLayout>
        <Entry x:Name="Enter" />
        <Button Text="Speak" Clicked="Button_Clicked" />
    </StackLayout>
</ContentPage.Content>

MainPage.xaml.cs

using Plugin.TextToSpeech;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Xamarin.Forms;

namespace XamarinTextToSpeech
{
public partial class MainPage : ContentPage
{
public MainPage()
{
InitializeComponent();
}

    private void Button_Clicked(object sender, EventArgs e)
    {
        var text = Enter.Text;
        CrossTextToSpeech.Current.Speak(text);

    }
}

}

But when I debug to an Android emulator and type in something to the Entry textbox, there is no sound. I have stepped through the code and the entered text definitely gets passed in.

Have I missed something? Any help would be much appreciated.

Sign In or Register to comment.