view nonExposed/checkOverlapping.m @ 44:b7b1672b3c3b

Reading and writing of files now is done by soundfile since there seems to be a bug with writing .wav files with librosa (mplayer would play them as rubbish). Added soundfile as a requirement.
author Emmanouil Theofanis Chourdakis <e.t.chourdakis@qmul.ac.uk>
date Mon, 09 Oct 2017 11:55:03 +0100
parents b1901e8d8f5f
children
line wrap: on
line source
function [] = checkcOverlapping(sceneSchedule,sceneDuration)
%% check overlapping
onset=[sceneSchedule(2:end).position];
offset=[sceneSchedule(2:end).duration]+onset;
[~,index]=sort(onset);
onset=onset(index);
offset=offset(index);
coveringIndice=onset(2:end)-offset(1:end-1);
if(find(coveringIndice<0))
    error('covering is not respected')
end

%% check sceneDuration
if(offset(end)>sceneDuration+0.1)
    error('Last event length is superior to the scene Duration')
end