diff src/com/aurellem/capture/audio/AudioSendRenderer.java @ 28:7184bc09a92e

need to solve audio recording clicks
author Robert McIntyre <rlm@mit.edu>
date Sun, 30 Oct 2011 10:00:29 -0700
parents 5249c8a9603c
children
line wrap: on
line diff
     1.1 --- a/src/com/aurellem/capture/audio/AudioSendRenderer.java	Sun Oct 30 08:10:26 2011 -0700
     1.2 +++ b/src/com/aurellem/capture/audio/AudioSendRenderer.java	Sun Oct 30 10:00:29 2011 -0700
     1.3 @@ -171,8 +171,14 @@
     1.4  
     1.5  	private ByteBuffer buffer = BufferUtils.createByteBuffer(4096); 
     1.6  	
     1.7 +	
     1.8 +	
     1.9 +	
    1.10 +	
    1.11  	public void dispatchAudio(float tpf){
    1.12 -		int samplesToGet = (int) (tpf * outputFormat.getSampleRate());
    1.13 +		
    1.14 +		int samplesToGet = (int)(tpf * 44100);
    1.15 +		org.lwjgl.input.Mouse.setGrabbed(false);
    1.16  		try {latch.await();} 
    1.17  		catch (InterruptedException e) {e.printStackTrace();}
    1.18  		audioSend.step(samplesToGet);
    1.19 @@ -184,7 +190,7 @@
    1.20  			SoundProcessor sp = 
    1.21  			this.soundProcessorMap.get(this.listeners.get(i));
    1.22  			if (null != sp){sp.process(buffer, outputFormat, 
    1.23 -					samplesToGet*outputFormat.getSampleSizeInBits()/8);}
    1.24 +					samplesToGet*4);}
    1.25  		}
    1.26  		
    1.27  	}