本文整理汇总了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;
}