matlab - change audio file sampling rate -


i want ask how can change sampling rate audio file in matlab r2016a?? default 44100 want change 22050 shown in code trying convert sampling rate, doesn't work...

 clear;  fs1 = 44100;  fs2 = 22050;  src = dsp.samplerateconverter('inputsamplerate',fs1,'outputsamplerate',fs2); [sa,src] = audioread('w_sound_1.wav');  % sa : of sampling , fs :sampling rate  sa_w = sa; audiowrite('w_sound_1_resampling.wav',sa_w,src) 

the reason it's not working don't use samplerateconverter object src anywhere. in fact, using src second output argument of audioread(), overwrite number containing current sample rate.

if want use samplerateconverter, check out examples here.

but, it's simpler use resample()


Comments

Popular posts from this blog

ios - RestKit 0.20 — CoreData: error: Failed to call designated initializer on NSManagedObject class (again) -

java - Digest auth with Spring Security using javaconfig -

laravel - PDOException in Connector.php line 55: SQLSTATE[HY000] [1045] Access denied for user 'root'@'localhost' (using password: YES) -