与众不同 windows phone (45) - 8.0 语音: TTS, 语音识别, 语音命令

简介: 原文:与众不同 windows phone (45) - 8.0 语音: TTS, 语音识别, 语音命令[源码下载] 与众不同 windows phone (45) - 8.0 语音: TTS, 语音识别, 语音命令 作者:webabcd介绍与众不同 windows phone 8.
原文: 与众不同 windows phone (45) - 8.0 语音: TTS, 语音识别, 语音命令

[源码下载]


与众不同 windows phone (45) - 8.0 语音: TTS, 语音识别, 语音命令



作者:webabcd


介绍
与众不同 windows phone 8.0 之 语音

  • TTS(Text To Speech)
  • 语音识别
  • 语音命令



示例
1、演示 TTS(Text To Speech)的应用
Speech/TTS.xaml

<phone:PhoneApplicationPage
    x:Class="Demo.Speech.TTS"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
    xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    FontFamily="{StaticResource PhoneFontFamilyNormal}"
    FontSize="{StaticResource PhoneFontSizeNormal}"
    Foreground="{StaticResource PhoneForegroundBrush}"
    SupportedOrientations="Portrait" Orientation="Portrait"
    mc:Ignorable="d"
    shell:SystemTray.IsVisible="True">

    <Grid Background="Transparent">
        <StackPanel Orientation="Vertical">

            <TextBlock Name="lblMsg" />
            
            <Button x:Name="btnTTS_Basic" Content="TTS 基础" Click="btnTTS_Basic_Click" />

            <Button x:Name="btnTTS_Select" Content="用指定的语音 TTS" Click="btnTTS_Select_Click" />

            <Button x:Name="btnTTS_SSML" Content="朗读 SSML 文档" Click="btnTTS_SSML_Click" />

        </StackPanel>
    </Grid>

</phone:PhoneApplicationPage>

Speech/TTS.xaml.cs

/*
 * 演示 TTS(Text To Speech)的应用
 * 
 * 
 * InstalledVoices - 管理已安装的语音
 *     All - 已安装的全部语音,返回 VoiceInformation 对象列表
 *     Default - 默认语音,返回 VoiceInformation 对象
 *     
 * VoiceInformation - 语音信息
 *     Id - 标识
 *     Language - 语言
 *     DisplayName - 名称
 *     Description - 描述
 *     Gender - 性别(VoiceGender.Male 或 VoiceGender.Female)
 * 
 * SpeechSynthesizer - TTS 的类
 *     SetVoice(VoiceInformation voiceInformation) - 设置语音
 *     GetVoice() - 获取语音信息
 *     SpeakTextAsync(string content, object userState) - 朗读指定的文本。可以设置一个上下文对象,在 SpeechStarted 时取出
 *     SpeakSsmlAsync(string content, object userState) - 朗读指定的 SSML 文档。可以设置一个上下文对象,在 SpeechStarted 时取出
 *     SpeakSsmlFromUriAsync(Uri content, object userState) - 朗读指定地址的 SSML 文档。可以设置一个上下文对象,在 SpeechStarted 时取出
 *     CancelAll() - 取消全部朗读
 *     SpeechStarted - 开始朗读时触发的事件
 *     BookmarkReached - 朗读到 <mark /> 标记时触发的事件(仅针对 SSML 协议)
 * 
 * 
 * 注:
 * 1、需要在 manifest 中增加配置 <Capability Name="ID_CAP_SPEECH_RECOGNITION" />
 * 2、SSML - Speech Synthesis Markup Language
 * 3、微软关于 ssml 的说明:http://msdn.microsoft.com/en-us/library/hh361578
 * 4、W3C 关于 ssml 的说明:http://www.w3.org/TR/speech-synthesis/
 */

using System;
using System.Collections.Generic;
using System.Linq;
using System.Windows;
using Microsoft.Phone.Controls;
using Windows.Phone.Speech.Synthesis;

namespace Demo.Speech
{
    public partial class TTS : PhoneApplicationPage
    {
        private string _text = "TTS 是 Text To Speech 的缩写<mark name=\"xxx\" />,即“从文本到语音”,是人机对话的一部分,让机器能够说话。";

        public TTS()
        {
            InitializeComponent();
        }

        // 默认方式朗读文本
        private async void btnTTS_Basic_Click(object sender, RoutedEventArgs e)
        {
            SpeechSynthesizer speechSynthesizer = new SpeechSynthesizer();
            await speechSynthesizer.SpeakTextAsync(_text);
        }

        // 用指定的语音朗读文本
        private async void btnTTS_Select_Click(object sender, RoutedEventArgs e)
        {
            SpeechSynthesizer speechSynthesizer = new SpeechSynthesizer();

            // 中文语音列表(应该有两条记录:第一条是女声;第二条是男声。具体信息可从 VoiceInformation 对象中获取)
            IEnumerable<VoiceInformation> zhVoices = from voice in InstalledVoices.All
                                                     where voice.Language == "zh-CN"
                                                     select voice;

            // 设置语音
            speechSynthesizer.SetVoice(zhVoices.ElementAt(0));

            // 朗读文本
            await speechSynthesizer.SpeakTextAsync(_text);
        }

        // 朗读指定 SSML 协议文档
        private async void btnTTS_SSML_Click(object sender, RoutedEventArgs e)
        {
            SpeechSynthesizer speechSynthesizer = new SpeechSynthesizer();

            // 开始朗读时触发的事件
            speechSynthesizer.SpeechStarted += speechSynthesizer_SpeechStarted;

            // 到达 <mark /> 标记时触发的事件
            speechSynthesizer.BookmarkReached += speechSynthesizer_BookmarkReached;

            // 微软关于 ssml 的说明:http://msdn.microsoft.com/en-us/library/hh361578
            // W3C 关于 ssml 的说明:http://www.w3.org/TR/speech-synthesis/

            string ssml = "<speak version=\"1.0\" xmlns=\"http://www.w3.org/2001/10/synthesis\" xml:lang=\"zh-CN\">"; // 中文
            ssml += "<voice gender=\"male\">"; // 男声
            ssml += "<prosody rate=\"-50%\">"; // 语速放慢 50%
            ssml += _text;
            ssml += "</prosody>";
            ssml += "</voice>";
            ssml += "</speak>";
          
            // 朗读 SSML
            await speechSynthesizer.SpeakSsmlAsync(ssml);
        }

        void speechSynthesizer_SpeechStarted(SpeechSynthesizer sender, SpeechStartedEventArgs args)
        {
            // 获取上下文对象
            object userState = args.UserState;
        }

        void speechSynthesizer_BookmarkReached(SpeechSynthesizer sender, SpeechBookmarkReachedEventArgs args)
        {
            this.Dispatcher.BeginInvoke(delegate() 
            {
                // 触发当前事件的 <mark /> 标记的名称
                lblMsg.Text = "mark name: " + args.Bookmark;
                lblMsg.Text += Environment.NewLine;

                // 朗读到触发当前事件的 <mark /> 标记所用的时间
                lblMsg.Text += "audio position: " + args.AudioPosition.TotalSeconds;
            });
        }
    }
}


2、演示如何通过自定义语法列表做语音识别,以及如何通过 SRGS 自定义语法做语音识别
Speech/SRGSGrammar.xml

<?xml version="1.0" encoding="utf-8"?>
<grammar version="1.0" xml:lang="zh-cn" root="Main" tag-format="semantics/1.0"
         xmlns="http://www.w3.org/2001/06/grammar"
         xmlns:sapi="http://schemas.microsoft.com/Speech/2002/06/SRGSExtensions">
  <rule id="Main">
    <item repeat="0-1">我想去</item>
    <ruleref uri="#Cities" />
  </rule>
  <rule id="Cities" scope="public">
    <one-of>
      <item>北京</item>
      <item>深圳</item>
      <item>上海</item>
      <item>广州</item>
    </one-of>
  </rule>
</grammar>

<!--
本例可以识别:我想去北京;我想去深圳;我想去上海;我想去广州;北京;深圳;上海;广州

Visual Studio 有创建 SRGSGrammar(SRGS 语法)文件的模板
微软关于 SRGS 的说明:http://msdn.microsoft.com/en-us/library/hh361653
W3C 关于 SRGS 的说明:http://www.w3.org/TR/speech-grammar/
-->

Speech/SpeechRecognition.xaml

<phone:PhoneApplicationPage
    x:Class="Demo.Speech.SpeechRecognition"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
    xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    FontFamily="{StaticResource PhoneFontFamilyNormal}"
    FontSize="{StaticResource PhoneFontSizeNormal}"
    Foreground="{StaticResource PhoneForegroundBrush}"
    SupportedOrientations="Portrait" Orientation="Portrait"
    mc:Ignorable="d"
    shell:SystemTray.IsVisible="True">

    <Grid Background="Transparent">
        <StackPanel Orientation="Vertical">

            <TextBlock Name="lblMsg" />

            <Button x:Name="btnDemo" Content="通过自定义语法列表做语音识别" Click="btnDemo_Click" />

            <Button x:Name="btnSRGS" Content="通过 SRGS 自定义语法做语音识别" Click="btnSRGS_Click" />
            
        </StackPanel>
    </Grid>

</phone:PhoneApplicationPage>

Speech/SpeechRecognition.xaml.cs

/*
 * 演示如何通过自定义语法列表做语音识别,以及如何通过 SRGS 自定义语法做语音识别
 * 
 * 
 * 语音识别:用于在 app 内识别语音
 * 语音命令:用于在 app 外通过语音命令启动 app
 *  
 * 
 * 注:
 * 1、需要在 manifest 中增加配置 <Capability Name="ID_CAP_SPEECH_RECOGNITION" /> <Capability Name="ID_CAP_MICROPHONE" />
 * 2、安装语音识别器:设置 -> 语音 -> 在“语音语言”列表中安装指定的语音识别器,并启用语音识别服务
 * 3、SRGS - Speech Recognition Grammar Specification
 * 4、微软关于 SRGS 的说明:http://msdn.microsoft.com/en-us/library/hh361653
 * 5、W3C 关于 SRGS 的说明:http://www.w3.org/TR/speech-grammar/
 */

using System;
using System.Collections.Generic;
using System.Linq;
using System.Windows;
using Microsoft.Phone.Controls;
using Windows.Phone.Speech.Recognition;

namespace Demo.Speech
{
    public partial class SpeechRecognition : PhoneApplicationPage
    {
        public SpeechRecognition()
        {
            InitializeComponent();
        }

        private async void btnDemo_Click(object sender, RoutedEventArgs e)
        {
            // 语音识别器,带 UI 的
            SpeechRecognizerUI speechRecognizerUI = new SpeechRecognizerUI();

            // 识别过程中发生问题时触发的事件
            speechRecognizerUI.Recognizer.AudioProblemOccurred += Recognizer_AudioProblemOccurred;
            // 音频捕获状态发生变化时触发的事件
            speechRecognizerUI.Recognizer.AudioCaptureStateChanged += Recognizer_AudioCaptureStateChanged;

            // InitialSilenceTimeout - 在此时间内收到的都是无声输入,则终止识别
            speechRecognizerUI.Recognizer.Settings.InitialSilenceTimeout = TimeSpan.FromSeconds(5.0);
            // EndSilenceTimeout - 语音识别开始后,如果此时间内都是无声输入,则识别结束
            speechRecognizerUI.Recognizer.Settings.EndSilenceTimeout = TimeSpan.FromSeconds(0.15);
            // BabbleTimeout - 在此时间内收到的都是噪音,则终止识别(0 代表禁用此功能)
            speechRecognizerUI.Recognizer.Settings.BabbleTimeout = TimeSpan.FromSeconds(0.0);

            // 获取中文语音识别器
            IEnumerable<SpeechRecognizerInformation> zhRecognizers = from recognizerInfo in InstalledSpeechRecognizers.All
                                                                     where recognizerInfo.Language == "zh-CN"
                                                                     select recognizerInfo;

            if (zhRecognizers.Count() > 0)
            {
                // 指定语音识别器
                speechRecognizerUI.Recognizer.SetRecognizer(zhRecognizers.First());

                // 设置语音识别的单词列表
                string[] phrases = { "xbox", "海贼王", "王磊" };
                speechRecognizerUI.Recognizer.Grammars.AddGrammarFromList("myWord", phrases);
                // speechRecognizerUI.Recognizer.Grammars.AddGrammarFromPredefinedType("dictation", SpeechPredefinedGrammar.Dictation); // 听写整句,基于本地的语音识别
                // speechRecognizerUI.Recognizer.Grammars.AddGrammarFromPredefinedType("webSearch", SpeechPredefinedGrammar.WebSearch); // 听写整句,基于网络的语音识别

                // 预加载全部语法
                await speechRecognizerUI.Recognizer.PreloadGrammarsAsync();

                // 带 UI 的语音识别器的监听页上显示的标题
                speechRecognizerUI.Settings.ListenText = "监听中。。。";

                // 带 UI 的语音识别器的监听页上显示的示例文本
                speechRecognizerUI.Settings.ExampleText = "精确识别:xbox, 海贼王, 王磊";

                // 在“您说的是”页(如果匹配到多条记录,则会在此页列出)和“听到您说”页是否需要通过 TTS 朗读识别的内容(当在语音设置中启用了“播放音频确认”时,此处 true 才会有效)
                speechRecognizerUI.Settings.ReadoutEnabled = true;

                // 是否显示“听到您说”页(用于显示识别出的最终文本)
                speechRecognizerUI.Settings.ShowConfirmation = false;

                try
                {
                    // 开始识别
                    SpeechRecognitionUIResult result = await speechRecognizerUI.RecognizeWithUIAsync();

                    // 输出识别状态和结果
                    lblMsg.Text = "识别状态: " + result.ResultStatus.ToString();
                    lblMsg.Text += Environment.NewLine;
                    lblMsg.Text += "识别结果:" + result.RecognitionResult.Text;
                    lblMsg.Text += Environment.NewLine;
                    lblMsg.Text += "可信度级别: " + result.RecognitionResult.TextConfidence.ToString(); // Rejected, Low, Medium, High
                }
                catch (Exception ex)
                {
                    if ((uint)ex.HResult == 0x800455BC)
                    {
                        lblMsg.Text = "当前语音识别器不支持所请求的语言: " + speechRecognizerUI.Recognizer.GetRecognizer().Language;
                    }
                    else
                    {
                        lblMsg.Text = ex.ToString();
                    }
                }
            }
            else
            {
                lblMsg.Text = "未安装中文语音识别器";
            }
        }

        void Recognizer_AudioCaptureStateChanged(SpeechRecognizer sender, SpeechRecognizerAudioCaptureStateChangedEventArgs args)
        {
            // 音频捕获状态发生了变化:Capturing(捕获中) 或 Inactive(未捕获)
            lblMsg.Text = "AudioCaptureStateChanged: " + args.State.ToString();
        }

        void Recognizer_AudioProblemOccurred(SpeechRecognizer sender, SpeechAudioProblemOccurredEventArgs args)
        {
            // 识别过程中发生了问题:TooLoud, TooQuiet, TooFast, TooSlow, TooNoisy, NoSignal, None
            lblMsg.Text = "AudioProblemOccurred: " + args.Problem.ToString();
        }



        // 通过 SRGS 自定义语法
        // 微软关于 SRGS 的说明:http://msdn.microsoft.com/en-us/library/hh361653
        // W3C 关于 SRGS 的说明:http://www.w3.org/TR/speech-grammar/
        private async void btnSRGS_Click(object sender, RoutedEventArgs e)
        {
            // 语音识别器,无 UI 的
            SpeechRecognizer speechRecognizer = new SpeechRecognizer();

            // 指定 SRGS 语法
            Uri mySRGS = new Uri("ms-appx:///Speech/SRGSGrammar.xml", UriKind.Absolute);
            speechRecognizer.Grammars.AddGrammarFromUri("srgs", mySRGS);

            try
            {
                lblMsg.Text = "监听中。。。";
                lblMsg.Text += Environment.NewLine;

                // 开始识别
                SpeechRecognitionResult result = await speechRecognizer.RecognizeAsync();

                // 输出识别结果
                lblMsg.Text += "识别结果:" + result.Text;
                lblMsg.Text += Environment.NewLine;
                lblMsg.Text += "可信度级别: " + result.TextConfidence.ToString(); // Rejected, Low, Medium, High
            }
            catch (Exception ex)
            {
                if ((uint)ex.HResult == 0x800455BC)
                {
                    lblMsg.Text = "当前语音识别器不支持所请求的语言: " + speechRecognizer.GetRecognizer().Language;
                }
                else
                {
                    lblMsg.Text = ex.ToString();
                }
            }
        }
    }
}


3、演示如何通过语音命令启动 app,以及 app 启动后如何获取启动此 app 的语音命令的标识和内容
Speech/VoiceCommandDefinition.xml

<?xml version="1.0" encoding="utf-8"?>
<VoiceCommands xmlns="http://schemas.microsoft.com/voicecommands/1.0">
  <CommandSet xml:lang="zh-cn">

    <!--命令前缀,不指定此值的话则会使用程序名做命令前缀-->
    <CommandPrefix>贪吃蛇</CommandPrefix>
    <!--语音监听窗口会随机显示不同 app 的语音命令提示文字(贪吃蛇 开始),轮到此 app 的时候就可能会显示这个-->
    <Example>开始</Example>

    <Command Name="PlayGame">
      <!--语音监听窗口会随机显示不同 app 的语音命令提示文字(贪吃蛇 开始),轮到此 app 的时候就可能会显示这个-->
      <Example>开始</Example>
      <!--监听语法-->
      <ListenFor>[马上] 开始</ListenFor>
      <!--监听语法-->
      <ListenFor>[马上] 启动</ListenFor>
      <!--准备启动目标 app 时,在监听窗口中显示的提示文字(当在语音设置中启用了“播放音频确认”时,此文字会作为 TTS 的文本)-->
      <Feedback>准备启动</Feedback>
      <!--启动页-->
      <Navigate Target="/Speech/VoiceCommands.xaml" />
    </Command>

    <Command Name="PlayLevel">
      <!--语音监听窗口会随机显示不同 app 的语音命令提示文字(贪吃蛇 从等级 2 开始),轮到此 app 的时候就可能会显示这个-->
      <Example>从等级 2 开始</Example>
      <!--监听语法-->
      <ListenFor>从等级 {number} 开始</ListenFor>
      <!--准备启动目标 app 时,在监听窗口中显示的提示文字(当在语音设置中启用了“播放音频确认”时,此文字会作为 TTS 的文本)-->
      <Feedback>正转到等级 {number}... </Feedback>
      <!--启动页-->
      <Navigate Target="/Speech/VoiceCommands.xaml" />
    </Command>

    <!--ListenFor 和 Feedback 可以通过 {number} 来引用此集合-->
    <PhraseList Label="number">
      <Item>1</Item>
      <Item>2</Item>
      <Item>3</Item>
    </PhraseList>

  </CommandSet>
</VoiceCommands>

<!--
本例可以识别:贪吃蛇开始,贪吃蛇马上开始,贪吃蛇启动,贪吃蛇马上启动,贪吃蛇从等级 1 开始,从等级 2 开始,从等级 3 开始

Visual Studio 有创建 VoiceCommandDefinition(语音命令定义)文件的模板
关于 VoiceCommands 的详细说明参见:http://msdn.microsoft.com/en-us/library/windowsphone/develop/jj207041
-->

Speech/VoiceCommands.xaml

<phone:PhoneApplicationPage
    x:Class="Demo.Speech.VoiceCommands"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
    xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    FontFamily="{StaticResource PhoneFontFamilyNormal}"
    FontSize="{StaticResource PhoneFontSizeNormal}"
    Foreground="{StaticResource PhoneForegroundBrush}"
    SupportedOrientations="Portrait" Orientation="Portrait"
    mc:Ignorable="d"
    shell:SystemTray.IsVisible="True">

    <Grid Background="Transparent">
        <StackPanel Orientation="Vertical">

            <TextBlock Name="lblMsg" TextWrapping="Wrap" Text="返回到开始屏幕,长按 windows 键,说出你的语音命令(语音命令的定义参见 VoiceCommandDefinition.xml)" />

        </StackPanel>
    </Grid>
    
</phone:PhoneApplicationPage>

Speech/VoiceCommands.xaml.cs

/*
 * 演示如何通过语音命令启动 app,以及 app 启动后如何获取启动此 app 的语音命令的标识和内容
 * 
 * 
 * 语音识别:用于在 app 内识别语音
 * 语音命令:用于在 app 外通过语音命令启动 app
 * 
 * 
 * 注:
 * 1、需要在 manifest 中增加配置 <Capability Name="ID_CAP_SPEECH_RECOGNITION" /> <Capability Name="ID_CAP_MICROPHONE" />
 * 2、关于 VoiceCommands 的详细说明参见:http://msdn.microsoft.com/en-us/library/windowsphone/develop/jj207041
 */

using System;
using System.Windows;
using Microsoft.Phone.Controls;
using Windows.Phone.Speech.VoiceCommands;
using System.Windows.Navigation;

namespace Demo.Speech
{
    public partial class VoiceCommands : PhoneApplicationPage
    {
        public VoiceCommands()
        {
            InitializeComponent();

            this.Loaded += VoiceCommands_Loaded;
        }

        private async void VoiceCommands_Loaded(object sender, RoutedEventArgs e)
        {
            // 向系统注册本 app 的语音命令定义
            await VoiceCommandService.InstallCommandSetsFromFileAsync(new Uri("ms-appx:///Speech/VoiceCommandDefinition.xml"));

            // 获取语音命令定义的 CommandSet 中的内容,可以动态修改
            // VoiceCommandService.InstalledCommandSets
        }

        protected override void OnNavigatedTo(NavigationEventArgs e)
        {
            // 通过语音命令启动时,url 类似如下:/Speech/VoiceCommands.xaml?voiceCommandName=PlayGame&reco=%E8%B4%AA%E5%90%83%E8%9B%87%20%E5%BC%80%E5%A7%8B

            if (NavigationContext.QueryString.ContainsKey("voiceCommandName"))
            {
                lblMsg.Text = "语音命令的标识: " + NavigationContext.QueryString["voiceCommandName"];
                lblMsg.Text += Environment.NewLine;
                lblMsg.Text += "语音命令的内容: " + NavigationContext.QueryString["reco"];
            }

            base.OnNavigatedTo(e);
        }
    }
}



OK
[源码下载]

相关实践学习
达摩院智能语音交互 - 声纹识别技术
声纹识别是基于每个发音人的发音器官构造不同,识别当前发音人的身份。按照任务具体分为两种: 声纹辨认:从说话人集合中判别出测试语音所属的说话人,为多选一的问题 声纹确认:判断测试语音是否由目标说话人所说,是二选一的问题(是或者不是) 按照应用具体分为两种: 文本相关:要求使用者重复指定的话语,通常包含与训练信息相同的文本(精度较高,适合当前应用模式) 文本无关:对使用者发音内容和语言没有要求,受信道环境影响比较大,精度不高 本课程主要介绍声纹识别的原型技术、系统架构及应用案例等。 讲师介绍: 郑斯奇,达摩院算法专家,毕业于美国哈佛大学,研究方向包括声纹识别、性别、年龄、语种识别等。致力于推动端侧声纹与个性化技术的研究和大规模应用。
目录
相关文章
|
人工智能 自然语言处理 语音技术
Step-Audio:开源语音交互新标杆!这个国产AI能说方言会rap,1个模型搞定ASR+TTS+角色扮演
Step-Audio 是由阶跃星辰团队推出的开源语音交互模型,支持多语言、方言和情感表达,能够实现高质量的语音识别、对话和合成。本文将详细介绍其核心功能和技术原理。
2725 91
Step-Audio:开源语音交互新标杆!这个国产AI能说方言会rap,1个模型搞定ASR+TTS+角色扮演
|
消息中间件 NoSQL Linux
Redis的基本介绍和安装方式(包括Linux和Windows版本),以及常用命令的演示
Redis(Remote Dictionary Server)是一个高性能的开源键值存储数据库。它支持字符串、列表、散列、集合等多种数据类型,具有持久化、发布/订阅等高级功能。由于其出色的性能和广泛的使用场景,Redis在应用程序中常作为高速缓存、消息队列等用途。
1101 16
|
网络协议 数据建模 数据安全/隐私保护
网安快速入门之Windows命令
本文简要介绍了Windows命令行中常用的11个命令,帮助快速入门网络安全和系统管理。这些命令包括:`help`(获取命令帮助)、`copy`(复制文件)、`dir`(显示目录内容)、`cd`(更改当前目录)、`type`(显示文本文件内容)、`del`(删除文件)、`ipconfig`(查看网络配置)、`net`(用户和组管理)、`netstat`(显示网络连接)、`tasklist`(显示进程信息)和`sc`(服务控制)。每个命令都有其特定用途,掌握它们可以大大提高工作效率和系统维护能力。
|
人工智能 自然语言处理 语音技术
Ultravox:端到端多模态大模型,能直接理解文本和语音内容,无需依赖语音识别
Ultravox是一款端到端的多模态大模型,能够直接理解文本和人类语音,无需依赖单独的语音识别阶段。该模型通过多模态投影器技术将音频数据转换为高维空间表示,显著提高了处理速度和响应时间。Ultravox具备实时语音理解、多模态交互、低成本部署等主要功能,适用于智能客服、虚拟助手、语言学习等多个应用场景。
1045 14
Ultravox:端到端多模态大模型,能直接理解文本和语音内容,无需依赖语音识别
|
API 语音技术
基于Asterisk和TTS/ASR语音识别的配置示例
基于Asterisk和TTS/ASR语音识别的配置示例如下:1. 安装Asterisk:首先,确保你已在服务器上成功安装Asterisk。可以选择从Asterisk官方网站下载最新版本的安装包并按照指南进行安装。2. 安装TTS引擎:选择适合你需求的TTS(Text-to-Speech)引擎,如Google Text-to-Speech、Microsoft Azure Cognitive Services等。按照所选TTS引擎的文档和指示进行安装和配置。3. 配置Asterisk:编辑Asterisk的配置文件,通常是`/etc/asterisk/extensions.conf
357 5
|
API 语音技术
基于Asterisk和TTS/ASR语音识别的配置示例
本文介绍了如何在Asterisk服务器上配置TTS(文本转语音)和ASR(自动语音识别)引擎,包括安装Asterisk、选择并配置TTS和ASR引擎、编辑Asterisk配置文件以实现语音识别和合成的功能,以及测试配置的有效性。具体步骤涉及下载安装包、编辑配置文件、设置API密钥等。
1132 1
|
存储 安全 数据库
适用于 Windows 的管理命令
以下命令可用于管理 Rational® Synergy。
307 1
|
人工智能 监控 安全
掌握Windows管理利器:WMI命令实战
本文介绍了Windows Management Instrumentation (WMI) 的基本概念和用途,通过多个实用的`wmic`命令示例,如获取CPU信息、查看操作系统详情、管理服务、检查磁盘空间等,展示了WMI在系统维护中的强大功能。适合IT专业人士学习和参考。
1616 4
|
Ubuntu 机器人 语音技术
语音识别与语音控制
【10月更文挑战第4天】硬件平台 机器硬件:OriginBot(导航版/视觉版)PC主机:Windows(>=10)/Ubuntu(>=20.04)扩展硬件:X3语音版 运行案例 首先进入OriginBot主控系统,运行一下指令。请注意,部分操作OriginBot内暂未放入,请根据内容进行适当处理。 cd /userdata/dev_ws/ # 配置TogetheROS环境 source /opt/tros/setup.bash # 从tros.b的安装路径中拷贝出运行示例需要的配置文件。 cp -r /opt/tros/lib/hobot_audio/config/ . # 加载
301 4
|
人工智能 语音技术 数据格式
三文带你轻松上手鸿蒙的AI语音01-实时语音识别
三文带你轻松上手鸿蒙的AI语音01-实时语音识别
622 0
三文带你轻松上手鸿蒙的AI语音01-实时语音识别

热门文章

最新文章