本文整理匯總了Java中org.xiph.speex.SpeexDecoder類的典型用法代碼示例。如果您正苦於以下問題:Java SpeexDecoder類的具體用法?Java SpeexDecoder怎麽用?Java SpeexDecoder使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
SpeexDecoder類屬於org.xiph.speex包,在下文中一共展示了SpeexDecoder類的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: initialize
import org.xiph.speex.SpeexDecoder; //導入依賴的package包/類
/**
* Prepares an audio stream to read from. If another stream is already opened,
* it will be closed and a new audio stream opened in its place.
* @param url URL to an audio file to stream from.
* @return False if an error occurred or if end of stream was reached.
*/
public boolean initialize( URL url )
{
initialized( SET, false );
cleanup();
if( url == null )
{
errorMessage( "url null in method 'initialize'" );
cleanup();
return false;
}
try
{
is = url.openStream();
dis = new DataInputStream( url.openStream() );
}
catch( IOException ioe )
{
errorMessage( "Unable to open stream in method 'initialize'" );
printStackTrace( ioe );
return false;
}
speexDecoder = new SpeexDecoder();
if( !processHeader() )
return false;
myAudioFormat = new AudioFormat( (float) sampleRate, 16, channels,
true, false );
endOfStream( SET, false );
initialized( SET, true );
return true;
}
示例2: JSpeexDecoder
import org.xiph.speex.SpeexDecoder; //導入依賴的package包/類
public JSpeexDecoder(Mixer mixer, int decoderId) {
super(mixer, decoderId);
decoder = new SpeexDecoder();
decoder.init(MODE_WIDEBAND, SAMPLERATE_WIDEBAND, CHANNELS_MONO, true);
}
示例3: version
import org.xiph.speex.SpeexDecoder; //導入依賴的package包/類
/**
* Returns the version of JSpeex being used.
* @return String indicating the version.
*/
public static String version()
{
return SpeexDecoder.VERSION;
}