How to audiowrite a soundfile from m4a to wav?
14 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Laura Sels
am 5 Jul. 2016
Kommentiert: Geoff Hayes
am 7 Jul. 2016
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!
0 Kommentare
Akzeptierte Antwort
Geoff Hayes
am 5 Jul. 2016
m4AFilename = 'hoi.m4a';
[y,Fs] = audioread(m4AFilename);
wavFilename = 'hoi.wav';
audio write(wavFilename,y,Fs);
Try the above and see what happens!
3 Kommentare
Geoff Hayes
am 7 Jul. 2016
Laura - presumably it isn't working because you haven't defined the y and Fs and so the line
audiowrite(filename, y, Fs);
fails. Is that correct? If so, then you need to define them
y = getaudiodata(r);
Fs = get(r,'SampleRate');
Weitere Antworten (1)
Thorsten
am 5 Jul. 2016
Use audioread to read the m4a. audioread returns y and Fs, and you can pass these to audio write:
[y, Fs] = audioread('hoi.m4a');
audiowrite('hoi.wav', y, Fs)
Siehe auch
Kategorien
Mehr zu Audio and Video Data finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!