Borrar filtros
Borrar filtros

Split .wav file into equal time segments

2 visualizaciones (últimos 30 días)
Shaula Garibbo
Shaula Garibbo el 15 de Oct. de 2019
Respondida: Star Strider el 15 de Oct. de 2019
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

Respuesta aceptada

Star Strider
Star Strider el 15 de Oct. de 2019
Use the Signal Processing Toolbox buffer function.

Más respuestas (0)

Community Treasure Hunt

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

Start Hunting!

Translated by