How to audiowrite time shifting audio?
4 views (last 30 days)
Show older comments
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');
0 Comments
Answers (1)
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
0 Comments
See Also
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!