필터 지우기
필터 지우기

extract chunks of small wav files in specific starting and ending times from a large wav file ?

조회 수: 1 (최근 30일)
I have the format of start time for ex: (format minutes, seconds, milliseconds) start time = '9,36.486' end time = '12,02.749' how can I extract the sound part exactly between those times from a wav file ? should I convert start and end time using datevec ? and how to extract those from the wav file (ex. audioread ) thanks a lot !!

채택된 답변

Jan
Jan 2017년 3월 29일
iTimeS = '9,36.486';
fTimeS = '12,02.749';
iTime = sscanf(strrep(strrep(iTimeS, '.', ''), ',', '.'), '%g');
fTime = sscanf(strrep(strrep(fTimeS, '.', ''), ',', '.'), '%g');
info = audioinfo(File);
sample = round([iTime, fTime] * info.SampleRate);
signal = audioread(File, sample);

추가 답변 (1개)

khaled hassan
khaled hassan 2017년 3월 30일
thanks a lot Jan!!, there is another thing, if I want to multiply in the '9,36.486'; The 36 with (100/60) and the 486 with *1/100. Can I split the '9,36.486', in three parts and multiply the parts and then recombine them ?

카테고리

Help CenterFile Exchange에서 Bartlett에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by