changing sampling rate of an audio

19 Ansichten (letzte 30 Tage)
Sam Johny George
Sam Johny George am 16 Okt. 2020
How to read a MP3 or WAV file and reduce it's sampling rate and save the new audio into a new file

Antworten (2)

Ameer Hamza
Ameer Hamza am 16 Okt. 2020
Bearbeitet: Ameer Hamza am 16 Okt. 2020
Something like this
[y, Fs] = audioread('audio_in.wav');
audiowrite('audio_out.wav', y, round(Fs/2));
This divides the sampling frequency by 2.
  1 Kommentar
Sebastien Dupertuis
Sebastien Dupertuis am 25 Feb. 2021
In the documentation, it is written that: audiowrite supports only samples rates of 44100 and 48000.
So doing:
audiowrite('audio_out.wav', y, round(Fs/2));
will not be accepted by audiowrite (except if the result of round(Fs/2) is 44100 and 48000).

Melden Sie sich an, um zu kommentieren.


Star Strider
Star Strider am 16 Okt. 2020
Import the file, then use the Signal Processing Toolbox resample function to resample it to a different sampling frequency.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by