首页
学习
活动
专区
圈层
工具
发布
    • 综合排序
    • 最热优先
    • 最新优先
    时间不限
  • 来自专栏林德熙的博客

    win10 uwp 选择文本转语音的机器人

    在 UWP 里的 SpeechSynthesizer 的 Voice 属性可以让咱设置所采用的机器人,但是此 VoiceInformation 对象却不能创建,不得不赞叹一下 API 设计者的强大 按照我也不知道哪学到的知识 也就是说即使自己开发了此功能,在用户端能否使用,完全需要取决于用户端是否安装了对应的语言包 在 UWP 下,不提供 VoiceInformation 对象的创建方法,必须通过 SpeechSynthesizer 例如以下代码就是挑选 Kangkang 机器人用来帮忙转文本 using Windows.Media.SpeechSynthesis; using (SpeechSynthesizer synthesizer = new SpeechSynthesizer()) { VoiceInformation voice = SpeechSynthesizer.AllVoices.FirstOrDefault synthesizer = new SpeechSynthesizer()) { VoiceInformation voice = SpeechSynthesizer.AllVoices.FirstOrDefault

    73210编辑于 2022-03-15
  • 来自专栏林德熙的博客

    win10 UWP 你写我读

    读出文本 在使用SpeechSynthesizer需要代码功能点 麦克风 ,需要申请,申请方式我就不说啦 ? ? 可以看到代码很少就可以做出想要的功能 private async void speech(string str, MediaElement media_element) { SpeechSynthesizer synthesizer = new SpeechSynthesizer(); SpeechSynthesisStream stream = await synthesizer.SynthesizeTextToStreamAsync media_element.SetSource(stream, stream.ContentType); media_element.Play(); } 实例化SpeechSynthesizer

    67210发布于 2018-09-18
  • 来自专栏喵叔's 专栏

    C#使用原生方法将文字朗读出来

    Console.ReadLine(); } private static void ReadAloud(string message) { SpeechSynthesizer speechSynthesizer = new SpeechSynthesizer(); speechSynthesizer.Volume = 100; speechSynthesizer.Rate = 10; speechSynthesizer.SpeakAsync(message); } } } 在上面的代码中我们将定义的 message 传入 SpeechSynthesizer 类的 SpeakAsync 方法里来实现阅读文字。

    1.3K10编辑于 2022-01-11
  • 来自专栏林德熙的博客

    win10 UWP 你写我读

    这个软件我用了你写我读,如果需要代码,请自己去下 https://github.com/lindexi/Markdown 点击 读出文本 在使用SpeechSynthesizer需要代码功能点 麦克风 可以看到代码很少就可以做出想要的功能 private async void speech(string str, MediaElement media_element) { SpeechSynthesizer synthesizer = new SpeechSynthesizer(); SpeechSynthesisStream stream = await synthesizer.SynthesizeTextToStreamAsync media_element.SetSource(stream, stream.ContentType); media_element.Play(); } 实例化SpeechSynthesizer

    44620编辑于 2022-08-04
  • 来自专栏码客

    iOS语音合成

    0.5 - 2] Default = 1 player.speakUtterance(u); 在iPhone6以下rate设置为0.1否则会读的很快 iOS的坑啊 代理方法 //开始播放 func speechSynthesizer AVSpeechSynthesizer, didStartSpeechUtterance utterance: AVSpeechUtterance) { print("开始播放") } //播放中 func speechSynthesizer / Double(utterance.speechString.characters.count); print("播放中,播放进度为:\(process)") } //播放完毕 func speechSynthesizer

    3.1K10发布于 2019-10-22
  • 来自专栏林德熙的博客

    win10 uwp 字符文本转语音声音文件方法

    在 UWP 中,支持将传入的字符串文本内容转换为音频语音,可以将这个语音声音通过 MediaElement 播放,或者将这个音频保存到文件里面 本文的方法是通过 SpeechSynthesizer 类提供的将 文本字符串 转换为 wav 的 Stream 对象实现的 核心的转换字符文本作为音频 Stream 代码如下 using (SpeechSynthesizer synthesizer = new SpeechSynthesizer

    88320发布于 2020-11-03
  • 来自专栏macOS 开发学习

    macOS 应用开发小集锦

    ) } 监听朗读事件 设置代理 let speach = NSSpeechSynthesizer() speach.delegate = self 实现相应的代理方法,监听事件回调 func speechSynthesizer NSRange, of string: String) { print("will speaKWord \(string) \(characterRange)") } func speechSynthesizer willSpeakPhoneme phonemeOpcode: Int16) { print("will speakPhoneme \(phonemeOpcode)") } func speechSynthesizer didEncounterSyncMessage message: String) { print("did encounter message \(message)") } func speechSynthesizer NSSpeechSynthesizer, didFinishSpeaking finishedSpeaking: Bool) { print("did finishedSpeaking ") } func speechSynthesizer

    93720发布于 2018-08-23
  • 来自专栏大宇笔记

    AVFoundation框架理论+实战一(文本语音转换)

    speechController = [[self alloc]init]; }); return speechController; } -(void)bulidSettings{ _speechSynthesizer ,@"/n"]]; } -(void)begainSpeakWitnIndex:(NSUInteger)page{ [_speechSynthesizer stopSpeakingAtBoundary utterance.pitchMultiplier = 0.8f; utterance.postUtteranceDelay = 0.1f; [self.speechSynthesizer speechController bulidSettings]; [_speechController begainSpeakWitnIndex:self.page]; _speechController.speechSynthesizer.delegate p%lu",(unsigned long)self.page]]; [_speechController begainSpeakWitnIndex:self.page]; } -(void)speechSynthesizer

    1.8K30发布于 2019-01-15
  • 来自专栏Android、鸿蒙开发

    Android 百度语音合成 (含离线、在线、API合成方式,详细步骤+源码)

    , MODEL_FILENAME); mSpeechSynthesizer.setParam(SpeechSynthesizer.PARAM_MIX_MODE, SpeechSynthesizer.MIX_MODE_DEFAULT , "9"); // 设置合成的语速,0-15 ,默认 5 mSpeechSynthesizer.setParam(SpeechSynthesizer.PARAM_SPEED , "5"); // 设置合成的语调,0-15 ,默认 5 mSpeechSynthesizer.setParam(SpeechSynthesizer.PARAM_PITCH params.put(SpeechSynthesizer.PARAM_TTS_SPEECH_MODEL_FILE, MODEL_FILENAME); } // 检测参数 , "5"); 设置合成的音量,0-15 ,默认 5 * mSpeechSynthesizer.setParam(SpeechSynthesizer.PARAM_SPEED, "5"

    3.7K20发布于 2021-05-10
  • 来自专栏前端专享

    使用 Web Speech API 和 ChatGPT API 开发一个智能语音机器人

    'TTS_REGION') const audioConfig = sdk.AudioConfig.fromDefaultSpeakerOutput() const speechSynthesizer = new SpeechSDK.SpeechSynthesizer(speechConfig, audioConfig) // 可以更改 Ssml 来改变声音 speechSynthesizer.speakSsmlAsync zh-CN-XiaoxiaoNeural">${text}</voice></speak>`, (result) => { if (result) { speechSynthesizer.close result.audioData } }, (error) => { console.log(error) speechSynthesizer.close

    2.8K30编辑于 2023-04-27
  • 来自专栏iOS 备忘录

    如何让iOS推送播放语音?

    在系统播放类AVSpeechSynthesizer的代理方法中,有播放完成的回掉speechSynthesizer:didFinishSpeechUtterance:,把呼出通知栏的代码self.contentHandler speakUtterance:utterance]; } - (AVSpeechSynthesizer *)speechSynthesizer { if (! _speechSynthesizer) { _speechSynthesizer = [[AVSpeechSynthesizer alloc] init]; _speechSynthesizer.delegate = self; } return _speechSynthesizer; } - (AVSpeechSynthesisVoice *)speechSynthesisVoice { AVSpeechSynthesisVoice voiceWithLanguage:@"zh-CN"]; } return _speechSynthesisVoice; } - (void)speechSynthesizer

    3.4K30发布于 2021-05-26
  • 来自专栏学习java的小白

    百度语音识别pom引入jar工具类

    @param word 文字内容 * @param outputPath 合成语音生成路径 * @return */ public static boolean SpeechSynthesizer audioInputStream; } public static void main(String[] args) throws IOException { // SpeechSynthesizer ("简单测试百度语音合成", "d:/SpeechSynthesizer.mp3"); //mp3转pcm格式 convertMP32Pcm("E:/KwDownload

    1.2K10发布于 2020-12-07
  • 来自专栏老欧说安卓

    Android开发笔记(一百零八)智能语音

    --SpeechSynthesizer.PARAM_VOLUME : 设置音量。取值范围为0-9,默认5。 --SpeechSynthesizer.PARAM_SPEED : 设置语速。 --SpeechSynthesizer.PARAM_PITCH : 设置音调。取值范围为0-9,默认5。 --SpeechSynthesizer.PARAM_AUDIO_ENCODE : 设置音频的编码类型。一般设置SpeechSynthesizer.AUDIO_ENCODE_AMR。 --SpeechSynthesizer.PARAM_AUDIO_RATE : 设置音频的编码速率。一般设置SpeechSynthesizer.AUDIO_BITRATE_AMR_15K85。 , SpeechSynthesizer.AUDIO_ENCODE_AMR); mSpeechSynthesizer.setParam(SpeechSynthesizer.PARAM_AUDIO_RATE

    6.7K20发布于 2019-01-18
  • 来自专栏历史专栏

    【愚公系列】2021年12月 攻防世界-简单题-MOBILE-012(你是谁)

    com.iflytek.cloud.SpeechError; import com.iflytek.cloud.SpeechRecognizer; import com.iflytek.cloud.SpeechSynthesizer Button button2; private AudioManager mAudioManager; private SpeechRecognizer mIat; private SpeechSynthesizer this.mIat = SpeechRecognizer.createRecognizer(this, this.mInitListener); this.mTts = SpeechSynthesizer.createSynthesizer com.iflytek.cloud.SpeechError; import com.iflytek.cloud.SpeechRecognizer; import com.iflytek.cloud.SpeechSynthesizer Button button2; private AudioManager mAudioManager; private SpeechRecognizer mIat; private SpeechSynthesizer

    53230编辑于 2022-12-01
  • 来自专栏咸鱼不闲

    科大讯飞语音识别和语音播放dome

    59522b3c"; public static void specking() { SpeechUtility.createUtility("appid=" + APPID); //1.创建SpeechSynthesizer 对象 SpeechSynthesizer mTts= SpeechSynthesizer.createSynthesizer( ); //2.合成参数设置,详见《MSC Reference Manual》SpeechSynthesizer 类 mTts.setParameter(SpeechConstant.VOICE_NAME, "xiaoyan"); //设置发音人

    6.1K50发布于 2018-10-31
  • 来自专栏Android开发指南

    Android语音识别

    recognizerDialogListener); iatDialog.show(); } /** * 语音朗诵 */ public void read(View view) { SpeechSynthesizer mTts = SpeechSynthesizer .createSynthesizer(this, null); mTts.setParameter(SpeechConstant.VOICE_NAME public void onError(SpeechError arg0) { } }; /** * 语音朗诵 */ public void read(String text) { SpeechSynthesizer mTts = SpeechSynthesizer .createSynthesizer(this, null); mTts.setParameter(SpeechConstant.VOICE_NAME

    10.1K11编辑于 2022-01-12
  • 来自专栏Android开发指南

    16.语音识别

    recognizerDialogListener); iatDialog.show(); } /** * 语音朗诵 */ public void read(View view) { SpeechSynthesizer mTts = SpeechSynthesizer .createSynthesizer(this, null); mTts.setParameter(SpeechConstant.VOICE_NAME public void onError(SpeechError arg0) { } }; /** * 语音朗诵 */ public void read(String text) { SpeechSynthesizer mTts = SpeechSynthesizer .createSynthesizer(this, null); mTts.setParameter(SpeechConstant.VOICE_NAME

    6.2K90发布于 2018-05-14
  • 来自专栏AI.NET极客圈

    .NET 的文本转语音合成

    KeepTalking { class Program { static void Main(string[] args) { var synthesizer = new SpeechSynthesizer 键入此代码后,IntelliSense 打开了包含 SpeechSynthesizer 类的所有公共方法和属性的窗口。 KeepTalking { class Program { static void Main(string[] args) { var synthesizer = new SpeechSynthesizer KeepTalking { class Program { static void Main(string[] args) { var synthesizer = new SpeechSynthesizer DoPrompt(ru); } private void DoPrompt(string culture) { var synthesizer = new SpeechSynthesizer

    2.7K20发布于 2019-07-19
  • 来自专栏iOS开发干货分享

    AVFoundation 文本转语音和音频录制 播放

    , es-MX) Swedish (sv-SE) Thai (th-TH) Turkish (tr-TR) AVSpeechSynthesizer 常用的delegate //开始朗读 func speechSynthesizer synthesizer: AVSpeechSynthesizer, didStart utterance: AVSpeechUtterance) { } //结束朗读 func speechSynthesizer AVSpeechSynthesizer, didFinish utterance: AVSpeechUtterance) { } //暂停朗读 func speechSynthesizer : AVSpeechSynthesizer, didPause utterance: AVSpeechUtterance) { } //继续朗读 func speechSynthesizer AVSpeechSynthesizer, didContinue utterance: AVSpeechUtterance) { } //将要播放的语音文字 func speechSynthesizer

    3.3K40发布于 2019-06-14
  • 来自专栏CSDNToQQCode

    TTS Text-to-speech(文字转语音)服务

    var audioConfig = AudioConfig.FromWavFileOutput("file1.wav"); using var synthesizer = new SpeechSynthesizer SpeechSDK.SpeechConfig.fromSubscription(subscriptionKey.value, serviceRegion.value); synthesizer = new SpeechSDK.SpeechSynthesizer

    4K20编辑于 2022-11-29
领券