How to audiowrite time shifting audio?

4 views (last 30 days)
Nazhan
Nazhan on 16 Nov 2019
Answered: Walter Roberson on 16 Nov 2019
hello, I made a code for time shifting. The graph appears good but I'm having a problem to audiowrite the time shifted audio. I code the audiowrite but when I play it does not play any sound. help me thanks
clc;
close all;
[sf,Fs] = audioread('signal.flac');
t=linspace(2,4,size(sf,1))'/Fs;
%time shifting
subplot(5,1,4);
plot(t,sf);
title('Time Shifting')
xlabel('Time Period');
ylabel('Amplitude');

Answers (1)

Walter Roberson
Walter Roberson on 16 Nov 2019
You cannot write an audio file at particular times. You must construct every sample from time 0.
In the simple case that would involve putting a number of samples with value 0 before the existing values, or removing some of the existing values. However you cannot just do that for fractional times

Categories

Find more on Audio Plugin Creation and Hosting in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!