本文整理匯總了Java中javax.sound.sampled.SourceDataLine.getFormat方法的典型用法代碼示例。如果您正苦於以下問題:Java SourceDataLine.getFormat方法的具體用法?Java SourceDataLine.getFormat怎麽用?Java SourceDataLine.getFormat使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類javax.sound.sampled.SourceDataLine
的用法示例。
在下文中一共展示了SourceDataLine.getFormat方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: JSAudioRecording
import javax.sound.sampled.SourceDataLine; //導入方法依賴的package包/類
JSAudioRecording(JSMinim sys, byte[] samps, SourceDataLine sdl,
AudioMetaData mdata)
{
system = sys;
samples = samps;
meta = mdata;
format = sdl.getFormat();
finished = false;
line = sdl;
loop = false;
play = false;
numLoops = 0;
loopBegin = 0;
loopEnd = (int)AudioUtils.millis2BytesFrameAligned( meta.length(),
format );
rawBytes = new byte[sdl.getBufferSize() / 8];
iothread = null;
totalBytesRead = 0;
bytesWritten = 0;
shouldRead = true;
}
示例2: JSAudioOutput
import javax.sound.sampled.SourceDataLine; //導入方法依賴的package包/類
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;
}
示例3: JSBaseAudioRecordingStream
import javax.sound.sampled.SourceDataLine; //導入方法依賴的package包/類
JSBaseAudioRecordingStream(JSMinim sys, AudioMetaData metaData,
AudioInputStream stream, SourceDataLine sdl, int inBufferSize, int msLen)
{
system = sys;
meta = metaData;
format = sdl.getFormat();
bufferSize = inBufferSize;
// allocate reading data
buffer = new FloatSampleBuffer( format.getChannels(), bufferSize, format.getSampleRate() );
system.debug( "JSBaseAudioRecordingStream :: FloatSampleBuffer has " + buffer.getSampleCount() + " samples." );
rawBytes = new byte[buffer.getByteArrayBufferSize( format )];
system.debug( "JSBaseAudioRecordingStream :: rawBytes has length " + rawBytes.length );
skipBytes = new byte[ (int)AudioUtils.millis2BytesFrameAligned( 10000, format ) ];
system.debug( "JSBaseAudioRecordingStream :: skipBytes has length " + skipBytes.length );
finished = false;
line = sdl;
ais = stream;
loop = false;
play = false;
numLoops = 0;
loopBegin = 0;
loopEnd = (int)AudioUtils.millis2BytesFrameAligned( msLen, format );
silence = new float[bufferSize];
iothread = null;
totalBytesRead = 0;
bytesWritten = 0;
shouldRead = true;
}