How to cut stereo audio file in matlab?

1 view (last 30 days)
Adrian Klopotowski
Adrian Klopotowski on 12 Oct 2020
Answered: Mario Malic on 12 Oct 2020
I cut out a piece of stereo audio, but when I did it, audio was saved as mono. I want to save it as a stereo.
[m,n] = size(audio);
dt=1/fs;
time = dt*(0:m-1);
idx = (time>=0.5) & (time<=7.5);
audio = audio(idx);
audiowrite(save_aduio_path, audio, fs);

Answers (1)

Mario Malic
Mario Malic on 12 Oct 2020
See Walter's answer here, hope it solves your problem.

Community Treasure Hunt

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

Start Hunting!