Concatenating cuts off length of overall .wav file (when summed)

1 回表示 (過去 30 日間)
asg_123
asg_123 2018 年 2 月 16 日
loc = 'insert dir of where you placed your files here';
filenames = {...
[loc, '\', 'audio1.wav'],
[loc, '\', 'audio2.wav'],
[loc, '\', 'audio3.wav']};
concat = [];
[y, Fs] = audioread(char(filenames {1}));
silence_length = 30; %%[sec]
silence_block = zeros(silence_length * Fs, 1);
pip_length = 0.2; % [s] length of each pip
number_of_pips = 3;
for i = 2:length(filenames)
[y, Fs] = audioread(char(filenames {1}));
frames_to_crop = pip_length * number_of_pips * Fs;
y = y(frames_to_crop+1:end);
concat = [concat; y];
end;
output_file = [loc, '\', 'concat_cond123', '.wav'];
audiowrite(output_file, concat, Fs);
Trying to concatenate 3 .wav files, each with exactly 13:20 in length. However, when I get the resulting 'concat_cond123.wav' file, the total time is only 26:40. (13:20*3 files) should be 39.60 in length, meaning there is about 13:20 of the overall concatenated .wav file that got cut off (could be one of the audio files?)
Still new to MatLab and Concatenating, but any help would be appreciated - thanks.
P.S. I'm getting a warning when I run the task in the Command Window stating:
>> MakeTaskfile
Warning: Integer operands are required for colon operator when used as index
> In MakeTaskfile (line 17)
Warning: Integer operands are required for colon operator when used as index
> In MakeTaskfile (line 17)

回答 (0 件)

カテゴリ

Help Center および File ExchangeCreating and Concatenating Matrices についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by