Only thing that I want to control is speed. not pitch.

53 vues (au cours des 30 derniers jours)
Daeil Jung
Daeil Jung le 10 Déc 2018
Commenté : adnan abid le 14 Jan 2021
[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?

Réponse acceptée

Jan
Jan le 10 Déc 2018
  3 commentaires
michael antonios
michael antonios le 22 Déc 2018
pls how can i change pitch without changing speed ???
Jan
Jan le 24 Déc 2018
@michael: Did you read my answer?

Connectez-vous pour commenter.

Plus de réponses (2)

Bilal AKBANA
Bilal AKBANA le 3 Avr 2020
Modifié(e) : Bilal AKBANA le 3 Avr 2020
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.
  1 commentaire
adnan abid
adnan abid le 14 Jan 2021
great work man thank you much your code helped a lot

Connectez-vous pour commenter.


Brian Hemmat
Brian Hemmat le 10 Déc 2019
Starting in R2019b, Audio Toolbox provides functions to shift pitch and time-stretch audio: shiftPitch, stretchAudio.
  2 commentaires
Brian Kardon
Brian Kardon le 18 Juin 2020
Those links appear to be invalid
Brian Hemmat
Brian Hemmat le 18 Juin 2020
sorry about that--fixed links

Connectez-vous pour commenter.

Catégories

En savoir plus sur Audio I/O and Waveform Generation dans Help Center et File Exchange

Tags

Produits


Version

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by