简体   繁体   中英

Reading .wav file in Matlab Coder

I want to read an audio file with matlab coder . The problem is that wavread() is not supported, but as this is a pretty essential part of any audio coding I am thinking that there must be another way to achieve this? Any ideas?

The WAV file format is fairly simple & widely documented for example here . You can use the low-level file IO functions, fopen() , fread() , fseek to read the file, assuming these are themselves available. This is exactly what wavread() does internally - take a look at the source.

What is your use case? If you really just want to run the generated code in a MEX-function within MATLAB you can use coder.extrinsic to call wavread. This will not work outside of the MATLAB environment.

Outside the MATLAB environment, you will need to use custom C code integration.

fopen() is now supported starting from Matlab 2013a. See here .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM