Skip to content
Snippets Groups Projects
Commit 8f72913c authored by Martin Karlsson's avatar Martin Karlsson
Browse files

update

parent d3a347df
No related branches found
No related tags found
No related merge requests found
figure;
allAudioLeft = [];
allAudio = []; allAudioRight = [];
lastLastIndex = 0; lastLastIndex = 0;
lastIndex = 0; lastIndex = 0;
count = 0; count = 0;
while count < 10 while count < 50
p = bass.Audio(); p = bass.Audio();
if count == 0 if count == 0
fs = p.Audio.sampleRate; fs = p.Audio.sampleRate;
end end
pause(1) pause(0.1)
lastIndex = p.Audio.lastFrameIndex; lastIndex = p.Audio.lastFrameIndex;
diffIndex = lastIndex - lastLastIndex; diffIndex = lastIndex - lastLastIndex;
temp = cell2mat(p.Audio.left); tempLeft = cell2mat(p.Audio.left);
temp = temp(max(end-diffIndex+1,1):end); tempLeft = tempLeft(max(end-diffIndex+1,1):end);
allAudio = [allAudio; temp]; allAudioLeft = [allAudioLeft; tempLeft];
tempRight = cell2mat(p.Audio.right);
tempRight = tempRight(max(end-diffIndex+1,1):end);
allAudioRight = [allAudioRight; tempRight];
lastLastIndex = lastIndex; lastLastIndex = lastIndex;
count = count+1 count = count+1
plot(tempLeft);
set(gca,'ylim',[-2^16/2 2^16/2])
drawnow
end end
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment