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

hej

parent b211e423
No related branches found
No related tags found
No related merge requests found
function signal = get_audio()
global bass;
persistent lastLastIndex;
persistent lastIndex;
persistent fs;
persistent p;
if isempty(fs)
p = bass.Audio();
fs = p.Audio.sampleRate;
lastLastIndex = 0;
lastIndex = 0;
end
p = bass.Audio();
pause(0.1)
lastIndex = p.Audio.lastFrameIndex;
diffIndex = lastIndex - lastLastIndex;
tempLeft = cell2mat(p.Audio.left);
tempLeft = tempLeft(max(end-diffIndex+1,1):end);
tempRight = cell2mat(p.Audio.right);
tempRight = tempRight(max(end-diffIndex+1,1):end);
lastLastIndex = lastIndex;
signal = [tempLeft; tempRight];
end
\ No newline at end of file
global client
global bass
addpath(genpath('~/openrobots/lib/matlab/'));
client = genomix.client('turtlebot1-wifi:8080');
bass = client.load('bass');
bass.Acquire('-a',24414,2048,80);
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment