Split .wav file into equal time segments

조회 수: 3 (최근 30일)
Shaula Garibbo
Shaula Garibbo 2019년 10월 15일
답변: Star Strider 2019년 10월 15일
Aim: write a code that will split a 1800 second long audio file into separate 60 second files.
I have this so far which creates a series of files consisting of the first 60, 120, 180 (etc.) seconds of the original .wav file. Am I missing something obvious or just approaching this in the wrong way?
for k = 1:60:1800
samples = [1, k*fs];
clear y fs;
[y, fs] = audioread(wavfile, samples);
filename = sprintf('VAALCO01-%d.wav', k);
audiowrite(filename,y,fs);
end

채택된 답변

Star Strider
Star Strider 2019년 10월 15일
Use the Signal Processing Toolbox buffer function.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Audio and Video Data에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by