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