# HG changeset patch # User Robert McIntyre # Date 1319994029 25200 # Node ID 7184bc09a92ed99696d5c438b76b5c926229ba5e # Parent 5249c8a9603ce6dbbc66e83c6580a06c68235d54 need to solve audio recording clicks diff -r 5249c8a9603c -r 7184bc09a92e src/com/aurellem/capture/audio/AudioSendRenderer.java --- a/src/com/aurellem/capture/audio/AudioSendRenderer.java Sun Oct 30 08:10:26 2011 -0700 +++ b/src/com/aurellem/capture/audio/AudioSendRenderer.java Sun Oct 30 10:00:29 2011 -0700 @@ -171,8 +171,14 @@ private ByteBuffer buffer = BufferUtils.createByteBuffer(4096); + + + + public void dispatchAudio(float tpf){ - int samplesToGet = (int) (tpf * outputFormat.getSampleRate()); + + int samplesToGet = (int)(tpf * 44100); + org.lwjgl.input.Mouse.setGrabbed(false); try {latch.await();} catch (InterruptedException e) {e.printStackTrace();} audioSend.step(samplesToGet); @@ -184,7 +190,7 @@ SoundProcessor sp = this.soundProcessorMap.get(this.listeners.get(i)); if (null != sp){sp.process(buffer, outputFormat, - samplesToGet*outputFormat.getSampleSizeInBits()/8);} + samplesToGet*4);} } } diff -r 5249c8a9603c -r 7184bc09a92e src/com/aurellem/capture/examples/AdvancedAudio.java --- a/src/com/aurellem/capture/examples/AdvancedAudio.java Sun Oct 30 08:10:26 2011 -0700 +++ b/src/com/aurellem/capture/examples/AdvancedAudio.java Sun Oct 30 10:00:29 2011 -0700 @@ -239,6 +239,9 @@ */ public void process(ByteBuffer audioSamples, AudioFormat format, int numSamples) { //System.out.println("I'm DANCING <3"); + + + entity.scale(this.scale); if (this.scale == 2f){this.scale = 0.5f;} else {this.scale = 2;} diff -r 5249c8a9603c -r 7184bc09a92e src/com/aurellem/capture/examples/Basic.java --- a/src/com/aurellem/capture/examples/Basic.java Sun Oct 30 08:10:26 2011 -0700 +++ b/src/com/aurellem/capture/examples/Basic.java Sun Oct 30 10:00:29 2011 -0700 @@ -26,6 +26,7 @@ File video = File.createTempFile("JME-water-video", ".avi"); File audio = File.createTempFile("JME-water-audio", ".wav"); + SimpleApplication app = new TestPostWater(); app.setTimer(new IsoTimer(60)); app.setShowSettings(false); @@ -34,7 +35,7 @@ Capture.captureAudio(app, audio); app.start(); - + System.out.println(video.getCanonicalPath()); System.out.println(audio.getCanonicalPath()); }