Filter löschen
Filter löschen

pauses in audio data

3 Ansichten (letzte 30 Tage)
Mengjia Lyu
Mengjia Lyu am 6 Jan. 2021
Dear community,
Is there a way to insert timed pauses (say 1s pause) into an audio array in MATLAB?

Antworten (1)

Kiran Felix Robert
Kiran Felix Robert am 12 Feb. 2021
Hi Mengjia,
You can use array concatenation to introduce pauses into an audio array.
Assuming you need to have a 1s pause and you will have Fs number of samples in one second (Fs is the sampling frequency), refer the following script for an example,
load gong.mat
% Fs -> Sampling Frequency
% y -> Audio data
% A 1 second pause, in one second you will have Fs number of samples
pause = zeros(Fs,1);
% New array Y
Y = [y(1:4201);pause;y(4202:end)]; % Array concatenation
sound(Y)

Kategorien

Mehr zu Audio I/O and Waveform Generation finden Sie in Help Center und File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by