当前位置: 首页>>代码示例>>Java>>正文


Java SourceDataLine.getFormat方法代码示例

本文整理汇总了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;
}
 
开发者ID:JacobRoth,项目名称:romanov,代码行数:22,代码来源:JSAudioRecording.java

示例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;
}
 
开发者ID:JacobRoth,项目名称:romanov,代码行数:13,代码来源:JSAudioOutput.java

示例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;
}
 
开发者ID:JacobRoth,项目名称:romanov,代码行数:35,代码来源:JSBaseAudioRecordingStream.java


注:本文中的javax.sound.sampled.SourceDataLine.getFormat方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。