• c# 语音(二)文字生成WAV文件


     private void CreateWAVFile(string text)
            {
                SaveFileDialog sfd = new SaveFileDialog();
                sfd.Filter = "所有文件 (*.*)|*.*|WAV 格式文件 (*.wav)|*.wav";
                sfd.Title = "保存到 wave 文件";
                sfd.FilterIndex = 2;
                sfd.RestoreDirectory = true;
                if (sfd.ShowDialog() == DialogResult.OK)
                {
                    SpeechStreamFileMode SpFileMode = SpeechStreamFileMode.SSFMCreateForWrite;
                    SpFileStream SpFileStream = new SpFileStream();
                    SpFileStream.Open(sfd.FileName, SpFileMode, false);
                    speech.AudioOutputStream = SpFileStream;
                    speech.Rate = -1;
                    speech.Volume = volume;
                    speech.Speak(text, SpeechVoiceSpeakFlags.SVSFlagsAsync);
                    speech.WaitUntilDone(Timeout.Infinite);
                    SpFileStream.Close();
                }
            }

  • 相关阅读:
    截取图片组件
    node之mongodb的DAO
    模块化开发插件,组件
    tweenMax实体抛物线
    defineProperties属性的运用==数据绑定
    程序概述
    JavaBase
    [luogu 1092] 虫食算 (暴力搜索剪枝)
    [luogu1073 Noip2009] 最优贸易 (dp || SPFA+分层图)
    [51Nod 1218] 最长递增子序列 V2 (LIS)
  • 原文地址:https://www.cnblogs.com/chengjunwei/p/3406806.html
Copyright © 2020-2023  润新知