Plating an audio (.wav) file in matlab.

1 view (last 30 days)
olivia
olivia on 2 Feb 2012
Hello
I found it very interesting that an audio file could be played using matlab. But I am unable to figure out the problem with the code that I am using to do so. I used the following code to play the file and get the samples:
hfile = 'w1.wav';
clear y Fs
% Read the data back into MATLAB, and listen to audio.
[y, Fs, nbits, readinfo] = wavread(hfile);
y,Fs,nbits,readinfo;
sound (y, Fs);
*??? Error using ==> wavread at 166 Out of memory. Type HELP MEMORY for your options.
Error in ==> project at 7 [y, Fs, nbits, readinfo] = wavread(hfile);*
Could anyone please tell me where I am going wrong or provide an alternative. Akso, I am using the awvread function, should I use some other function?
Thanks

Answers (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!