Convert audio file to a byte array in matlab

无人久伴 提交于 2019-12-02 14:24:09

If you want to read the raw audio data, use audioread. You call it like so:

[y,Fs] = audioread(filename);

filename would be the file name of your file (.mp3/.wav) and what is returned is a matrix of values stored in y and the sampling frequency of the file in Fs. y would be a matrix such that the number of rows tells you the number of samples that your audio consists of, and the number of columns tells you how many channels the audio has. For example, mono audio would be a single column vector while stereo audio would be a two-column matrix: the first column being the left channel and the second column being the right channel.

For more information, check out the MathWorks doc I linked you to above.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!