How can I change sampling frequency when I use audiowrite function?
19 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Baran Baysal
el 9 de Jul. de 2020
Respondida: Star Strider
el 9 de Jul. de 2020
Hi, I have an mp3 file that I upload to matlab using audioread function, which gives me an audio signal which is stored in a 25392x1 matrix with the sampling frequency of 22050 which is stored in a variable called 'Fs'. I am trying to save this audio signal in a 'mp4' format using the audiowrite function. When I try using the variable Fs or 22050 is gives the error following error:
Error using audiowrite (line 203)
Unsupported SampleRate value.
Error in audio_signal (line 90)
audiowrite('reconstructed_computer_male.mp4', a, 22050);
Intresting thing is, when I put in Fs*2 or 44100, the function works just fine. The problem with that is the mp4 file that is saved is not an accurate representation of the audio signal because it is twice as fast as it should be. I checked the type of the variable which is double in both cases but only one of the cases work. How can I save this audio signal with the right sampling frequency, which is 22050?
0 comentarios
Respuesta aceptada
Más respuestas (0)
Ver también
Categorías
Más información sobre Audio Plugin Creation and Hosting 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!