get_audio_loop.m 428 Bytes
Newer Older
Martin Karlsson's avatar
Martin Karlsson committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21


allAudio = [];
lastLastIndex = 0;
lastIndex = 0;
count = 0;
while count < 10
    p = bass.Audio();
    if count == 0
        fs = p.Audio.sampleRate;
    end
    pause(1)
    lastIndex = p.Audio.lastFrameIndex;
    diffIndex = lastIndex - lastLastIndex;
    temp = cell2mat(p.Audio.left);
    temp = temp(max(end-diffIndex+1,1):end);
    allAudio = [allAudio; temp];
    
    lastLastIndex = lastIndex;
    count = count+1
end