国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 學院 > 開發設計 > 正文

matlab工具箱TTSBOX源碼中文分析

2019-11-10 17:09:09
字體:
來源:轉載
供稿:網友
function wav = tts(txt,voice,pace,fs)%TTS text to speech.%   TTS (TXT) synthesizes speech from string TXT, and speaks it. The audio%   format is mono, 16 bit, 16k Hz by default.%   %   WAV = TTS(TXT) does not vocalize but output to the variable WAV.%%   TTS(TXT,VOICE) uses the specific voice. Use TTS('','List') to see a%   list of availble voices. Default is the first voice.%%   TTS(...,PACE) set the pace of speech to PACE. PACE ranges from %   -10 (slowest) to 10 (fastest). Default 0.%%   TTS(...,FS) set the sampling rate of the speech to FS kHz. FS must be%   one of the following: 8000, 11025, 12000, 16000, 22050, 24000, 32000,%       44100, 48000. Default 16.%   %   This function requires the Microsoft Win32 Speech API (SAPI).%%   Examples:%       % Speak the text;%       tts('I can speak.');%       % List availble voices;%       tts('I can speak.','List');%       % Do not speak out, store the speech in a variable;%       w = tts('I can speak.',[],-4,44100);%       wavplay(w,44100);%%   See also WAVREAD, WAVWRITE, WAVPLAY.% Written by Siyi Deng; 12-21-2007;if ~ispc, error('Microsoft Win32 SAPI is required.'); endif ~ischar(txt), error('First input must be string.'); endSV = actxserver('SAPI.SpVoice');%創建一個object對象COM.SAPI_SpVoiceTK = invoke(SV,'GetVoices');%創建一個object對象Interface.928....if nargin > 1   %判斷參數多余一個 % Select voice;%根據文字選擇中文發音對象或者英文發音對象?;蜻@系統中的其他國家語言發音對象    for k = 0:TK.Count-1        if strcmpi(voice,TK.Item(k).GetDescription)            SV.Voice = TK.Item(k);            break;        elseif strcmpi(voice,'list')            disp(TK.Item(k).GetDescription);        end    end    % Set pace;    if nargin > 2        if isempty(pace), pace = 0; end %如果pace為空那么默認不加速        if abs(pace) > 10, pace = sign(pace)*10; end %如果加/減速大于10那么只取左右端的極限               SV.Rate = pace;%接口語音速率設置    endendif nargin < 4 || ~ismember(fs,[8000,11025,12000,16000,22050,24000,32000,...        44100,48000]), fs = 16000; end %如果沒有采樣頻率或者采樣頻率取值不再規定成員里面,那么使用默認值 16kHzif nargout > 0  %如果函數有輸入參數   % Output variable;   MS = actxserver('SAPI.SpMemoryStream');%創建COM.API_SpMemoryStream對象   MS.Format.Type = s
發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 鄯善县| 葵青区| 沿河| 偏关县| 涞水县| 普安县| 塘沽区| 新余市| 佛山市| 开平市| 庐江县| 湘潭县| 庆安县| 韶关市| 辽阳县| 集安市| 库尔勒市| 五指山市| 莱西市| 肥城市| 轮台县| 微山县| 建始县| 日土县| 壶关县| 石屏县| 永和县| 宿迁市| 海阳市| 南城县| 德安县| 吉木乃县| 萨嘎县| 渭源县| 小金县| 大兴区| 临洮县| 波密县| 黔西县| 广安市| 台江县|