Code example for SourceDataLine

Methods: getFormat

0
 
	JSAudioOutput(SourceDataLine sdl, int bufferSize)
	{ 
		super(); 
		this.bufferSize = bufferSize;
		format = sdl.getFormat();
 
		buffer = new FloatSampleBuffer(format.getChannels(), bufferSize, format.getSampleRate());
		mcBuffer = new MultiChannelBuffer(bufferSize, format.getChannels());
		outBytes = new byte[buffer.getByteArrayBufferSize(format)];
		finished = false;
		line = sdl;
	} 
 
	public void run() 
	{ 
		line.start();
		while (!finished)
		{ 
			buffer.makeSilence();