如何阅读".wav"文件到MATLAB吗? [英] How to read a ".wav" file into MATLAB?
问题描述
我想在MATLAB中输入wave文件,以便可以使用过滤器对其进行处理,当我输入名为wave.wav
的wave文件时,该文件位于我的桌面上,然后使用
I wanted to input a wave file in the MATLAB so that I could process it using filters, when I come to input the wave file called wave.wav
, this file is located on my desktop, and then I used
[y, fs, nb] = wavread('wave.wav');
读取wave文件,但总是出现错误cannot open file
,我唯一能想到的是该函数不知道wave.wav
的路径,有帮助吗?
读完sound()
后如何使用MATLAB播放文件?
to read the wave file but always gives me an error cannot open file
, the only thing I can think of is that the function doesnt know the path of the wave.wav
, any help?
And how can I play the file also using MATLAB after read, sound()
?
推荐答案
是的,您在两个方面都是正确的.使用文件的完整路径,然后使用sound
功能进行播放.有关完整示例,请参见此参考页. Mathworks的文档非常全面.
Yes, you are correct on both counts. Use the full path to the file, and use the sound
function to play it back. See this reference page for a thorough example. The documentation from the Mathworks is quite comprehensive.
这篇关于如何阅读".wav"文件到MATLAB吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!