- 1、本文档共46页,可阅读全部内容。
- 2、有哪些信誉好的足球投注网站(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。
- 3、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载。
- 4、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
查看更多
20-音讯读写、录制与播放
非同步播放 在此例中,我們會聽到類似男女兩部合唱,一快一慢,這是因為 sound 指令的預設播放方式就是「非同步」。 範例20-13: playSync02.m load handel.mat sound(y, Fs); sound(y, 1.2*Fs); Playback Modes There are two playback modes Synchronous mode: Block everything till the end of playback. Asychronous mode: Nonblocking playSync01.m playSync02.m [y, fs]=audioread(welcome.wav); p=audioplayer(y, fs); playblocking(p); % Synchronous sound(y, 0.8*fs); % Asynchronous sound(y, 0.6*fs); % Asynchronous load handel.mat sound(y, Fs); sound(y, 1.2*Fs); 音量自動調整 另一個類似的指令是 soundsc,可針對音訊變數的數值先進行正規化(介於 –1 和 1 中間)後,再送到喇叭播放,以達到最好的播放效果。 soundsc01.m [y, fs]=audioread(welcome.wav); sound(y, fs); fprintf(Press any key to continue...\n); pause soundsc(y, fs); 在影像顯示方面,對應的命令是 imagesc。 Automatic Volume Adjustment “soundsc” adjusts the volume (by normalizing the signals to have max of 1 or min of -1) before playback soundsc01.m [y, fs]=audioread(welcome.wav); sound(y, fs); fprintf(Press any key to continue...\n); pause soundsc(y, fs); The corresponding command for image display is “imagesc”. 聲音訊號的錄製 我們在第一節已經說明了如何讀取音訊檔案,並在第二節說明如何播放。MATLAB 也支援直接由麥克風讀取訊號,因此可以直接進行聲音的錄製,所使用的指令是 audiorecorder recordblocking Recording of Audio Signals We can use the following MATLAB commands for recording from the microphone directly: audiorecorder recordblocking 音訊的錄製範例 (1/2) 使用預設參數,由麥克風進行3秒錄音: audioRecord01.m 預設錄音參數 取樣頻率為 8000 Hz 取樣點解析度為 8 bits 單聲道錄音 duration=3; % 錄音時間 recObj=audiorecorder; fprintf(按任意鍵後開始 %g 秒錄音:, duration); pause fprintf(錄音中...); recordblocking(recObj, duration); fprintf(錄音結束\n); fprintf(按任意鍵後開始播放:); pause play(recObj); Recording (1/2) Use default setting for 3-sec recording: audioRecord01.m Default settings for recording Sample rate: 8000 Hz Bit resolution: 8 bits Mono duration=3; % Duration of recording recObj=audiorecorder; fprintf(按任意鍵後開始 %g 秒錄音:, duration); pause % Prompt fprintf(錄音中...); % During recording recordblocking(recObj, duration); fprintf(錄音結束\n); % End of recording fprintf(按任意鍵後開始播放:); pause % Press any key for playback
您可能关注的文档
- 106学年度中区县市政府教师甄选策略联盟.PDF
- 101N08xx系列12-24伏直流BD控制器 - Danfoss.PDF
- 104年国中教育会考英语科试题详解听力试题第一部分:辨识句意(第1.PDF
- 10W防削顶双声道D类音频功率放大器.PDF
- 110所医学院校学报编辑人员的调查与简析-中国科技期刊研究.PDF
- 105-106年度医院医疗品质及病人安全工作目标_手册(PDF).PDF
- 107在双声道高保真立体声时代-四维.PDF
- 1114数码相机的选购.PPT
- 11335乘客舱车顶部件视图.DOC
- 10-河南省煤气(集团)有限责任公司-国家安全生产监督管理总局化学.PPT
- 《中国通史》文字稿第12集春秋争霸.docx
- java教程--类与对象-讲义课件(演讲稿).ppt
- Vue应用程序开发-(1).pptx
- 东北师大版社劳动实践与评价指导手册一年级上册主题二活动一寻找五彩的树叶课时课件.pptx
- 外研版英语四年级上册 Module 4 Unit 2 How much is it单元教学设计.docx
- 外研版英语四年级上册Module 4 单元整体教学设计.docx
- 6《上课之前》课件 鄂科技版 心理健康教育一年级.pptx
- 《1~5的认识》说课课件(共25张PPT)人教版一年级上册数学.pptx
- 六《解决问题(1)》说课课件 人教版 三年级上册数学.pptx
- 七《解决问题》说课课件 人教版 二年级上册数学.pptx
文档评论(0)