MATLAB: How to audiowrite a soundfile from m4a to wav

audio

Hello!
I want to write an audiofile from m4a to wav? I thought it was easy, but I miss something I guess..
This is what I'm doing:
load hoi.m4a
filename='hoi.wav'
audiowrite(filename, y, Fs)
This is what the help function says, but what am I supposed to fill in on y and Fs?
Thanks!

Best Answer

Laura - I think that you want to use audioread first as
m4AFilename = 'hoi.m4a';
[y,Fs] = audioread(m4AFilename);
and then write it as a wav file using audiowrite as
wavFilename = 'hoi.wav';
audio write(wavFilename,y,Fs);
Try the above and see what happens!