- https://www.mathworks.com/matlabcentral/answers/106660-how-can-i-alter-the-speed-of-a-wav-file-without-altering-its-pitch
- https://dsp.stackexchange.com/questions/45794/how-to-change-speed-of-audio-samples-without-changing-pitch
- https://dsp.stackexchange.com/questions/31850/slow-down-music-playing-while-maintaining-frequency
Only thing that I want to control is speed. not pitch.
26 次查看(过去 30 天)
显示 更早的评论
[Q, S] = audioread("sample.mp3");
speed = 1.2;
S = S * speed;
soundsc(Q,S);
This is what I do.
as you know, this code makes increase both pitch and speed.
but I want to make change only speed.
How can I control it?
**and How can I only control pitch?
0 个评论
采纳的回答
Jan
2018-12-10
Start with searching in the net, especially in this forum:
The problem is complex.
3 个评论
更多回答(2 个)
Bilal AKBANA
2020-4-3
编辑:Bilal AKBANA
2020-4-3
THIS IS THE CLEAR ANSWER I THINK COVERING BOTH VOLUME AND SPEED OF THE SOUND WITH CONDITION THAT YOU HAVE stretchAudio FUNCTION RELEASED AS OF R2019b. THIS ALGORITM CAN CHANGE THE SPEED AND VOLUME OF THE AUDIO WITHOUT MAKING IT SOUND FUNNY.
[y, fs] = audioread("sample.mp3"); % read audio file.
speed = 1.2; % increase speed of sound 1.2 times than the given speed.
volume = 2; % increase volume of sound 2 times than the given volume.
y = stretchAudio(volume*y,speed);
sound(y,fs); % my recommendation is to use sound instead of soundsc
% clear sound; % to stop sound
% OR INSTEAD OF sound you can use
player = audioplayer(y,fs);
% play(player); % comment this out it will play.
% stop(player); % comment this out it will stop.
Brian Hemmat
2019-12-10
Starting in R2019b, Audio Toolbox provides functions to shift pitch and time-stretch audio: shiftPitch, stretchAudio.
2 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Audio and Video Data 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!