How to audiowrite a soundfile from m4a to wav?
16 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
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 commentaires
Réponse acceptée
Geoff Hayes
le 5 Juil 2016
m4AFilename = 'hoi.m4a';
[y,Fs] = audioread(m4AFilename);
wavFilename = 'hoi.wav';
audio write(wavFilename,y,Fs);
Try the above and see what happens!
3 commentaires
Geoff Hayes
le 7 Juil 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');
Plus de réponses (1)
Thorsten
le 5 Juil 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)
Voir également
Catégories
En savoir plus sur Audio and Video Data dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!