How do I implement the MATLAB function wavread in C++?
It means read a WAV file into a vector array.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
If you want to do it in C++, there are two options. Use a library, or write your own function that can extract information from WAV files. Several C/C++ libraries such as Juce, SDL etc. have functions/classes that can read WAV files. This is probably total overkill for your case. If you want a simple(ish) library specialised to read audio files, libsndfile sounds (pun not intended) like a good bet. If you must roll your own implementation, a description of the WAV format in C can be found here (Warning: The link leads to a page that allows you to download a zipped MS Word file).