How can I change sampling frequency when I use audiowrite function?
19 views (last 30 days)
Show older comments
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 Comments
Accepted Answer
More Answers (0)
See Also
Categories
Find more on Audio Plugin Creation and Hosting in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!