How to audiowrite a soundfile from m4a to wav?
16 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Laura Sels
el 5 de Jul. de 2016
Comentada: Geoff Hayes
el 7 de Jul. de 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 comentarios
Respuesta aceptada
Geoff Hayes
el 5 de Jul. de 2016
m4AFilename = 'hoi.m4a';
[y,Fs] = audioread(m4AFilename);
wavFilename = 'hoi.wav';
audio write(wavFilename,y,Fs);
Try the above and see what happens!
3 comentarios
Geoff Hayes
el 7 de Jul. de 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');
Más respuestas (1)
Thorsten
el 5 de Jul. de 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)
Ver también
Categorías
Más información sobre Audio and Video Data en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!