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

51 ビュー (過去 30 日間)
Daeil Jung
Daeil Jung 2018 年 12 月 10 日
コメント済み: adnan abid 2021 年 1 月 14 日
[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?

採用された回答

Jan
Jan 2018 年 12 月 10 日
  3 件のコメント
michael antonios
michael antonios 2018 年 12 月 22 日
pls how can i change pitch without changing speed ???
Jan
Jan 2018 年 12 月 24 日
@michael: Did you read my answer?

サインインしてコメントする。

その他の回答 (2 件)

Bilal AKBANA
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.
  1 件のコメント
adnan abid
adnan abid 2021 年 1 月 14 日
great work man thank you much your code helped a lot

サインインしてコメントする。


Brian Hemmat
Brian Hemmat 2019 年 12 月 10 日
Starting in R2019b, Audio Toolbox provides functions to shift pitch and time-stretch audio: shiftPitch, stretchAudio.
  2 件のコメント
Brian Kardon
Brian Kardon 2020 年 6 月 18 日
Those links appear to be invalid
Brian Hemmat
Brian Hemmat 2020 年 6 月 18 日
sorry about that--fixed links

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeAudio I/O and Waveform Generation についてさらに検索

タグ

製品


リリース

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by