diff --git a/get_audio.m b/get_audio.m index 0bf8bb17ffb3e6051a203b620b2c8a3bca71a4f1..0de0d875f970f2ebeacc577433b94e12bc0151c2 100644 --- a/get_audio.m +++ b/get_audio.m @@ -2,7 +2,6 @@ function signal = get_audio() global bass; - persistent lastLastIndex; persistent lastIndex; persistent fs; @@ -32,6 +31,10 @@ tempRight = tempRight(max(end-diffIndex+1,1):end); lastLastIndex = lastIndex; -signal = [tempLeft; tempRight]; +signal = [tempLeft, tempRight]; + + + +%bass.Stop(); end \ No newline at end of file diff --git a/get_audio_loop.m b/get_audio_loop.m index 5b6b4726f40cbd80b6ead3e5f5a1962f4a3cfcf2..6b9b9f10683a09ce5593dbb8092e8898e2c0d1a0 100644 --- a/get_audio_loop.m +++ b/get_audio_loop.m @@ -1,6 +1,3 @@ -addpath(genpath('~/openrobots/lib/matlab/')); -client = genomix.client('turtlebot1-wifi:8080'); -bass = client.load('bass'); figure; @@ -10,7 +7,7 @@ allAudioRight = []; lastLastIndex = 0; lastIndex = 0; count = 0; -while count < 50 +while count < 5 p = bass.Audio(); if count == 0 fs = p.Audio.sampleRate; @@ -34,3 +31,7 @@ while count < 50 drawnow end + + +bass.Stop() +