當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。