Speech Recognition and Synthesis
Converted to text (STT) through microphone voice capture, or read aloud through text (TTS)
This set of components is built-in Azure
and Baidu
Speech service, this example relies on BootstrapBlazor.BaiduSpeech
,When using this component, you need to reference its component package
BootstrapBlazor.BaiduSpeech
, which needs to reference its component package when using this componentBootstrapBlazor.BaiduSpeech
componentdotnet add package BootstrapBlazor.BaiduSpeech
<PackageReference Include="BootstrapBlazor.BaiduSpeech" Version="7.1.0" />
Install-Package BootstrapBlazor.BaiduSpeech
- Click start After pressing the button, speak to the computer:'Please turn on the light for me'
- After the computer receives the command, it will ask Are you sure you want to turn on the light? Please confirm!
- You speak to the computer:confirm
- The computer executes the command and enters it in the text box below has been opened for you text
// Add Baidu voice service
builder.Services.AddBootstrapBlazorBaiduSpeech();
// speech recognition service
[Inject]
[NotNull]
private RecognizerService? RecognizerService { get; set; }
// speech synthesis service
[Inject]
[NotNull]
private SynthesizerService? SynthesizerService { get; set; }