|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectpaulscode.sound.codecs.CodecJSpeex
public class CodecJSpeex
The CodecJSpeex class provides an ICodec interface for reading from
files encoded by Speex.
SoundSystem CodecJSpeex Class License:
You are free to use this class for any purpose, commercial or otherwise.
You may modify this class or source code, and distribute it any way you
like, provided the following conditions are met:
1) You may not falsely claim to be the author of this class or any
unmodified portion of it.
2) You may not copyright this class or a modified version of it and then
sue me for copyright infringement.
3) If you modify the source code, you must clearly document the changes
made before redistributing the modified source code, so other users know
it is not the original code.
4) You are not required to give me credit for this class in any derived
work, but if you do, you must also mention my website:
http://www.paulscode.com
5) I the author will not be responsible for any damages (physical,
financial, or otherwise) caused by the use if this class or any portion
of it.
6) I the author do not guarantee, warrant, or make any representations,
either expressed or implied, regarding the use of this class or any
portion of it.
Author: Paul Lamb
http://www.paulscode.com
This software is based on or using the JSpeex library available from
http://jspeex.sourceforge.net/index.php
JSpeex is a Java port of the Speex speech codec. For more information,
visit http://www.speex.org/
JSpeex License:
Copyright (c) 1999-2003 Wimba S.A., All Rights Reserved.
COPYRIGHT:
This software is the property of Wimba S.A.
This software is redistributed under the Xiph.org variant of
the BSD license.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
- Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
- Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
- Neither the name of Wimba, the Xiph.org Foundation nor the names of
its contributors may be used to endorse or promote products derived
from this software without specific prior written permission.
WARRANTIES:
This software is made available by the authors in the hope
that it will be useful, but without any warranty.
Wimba S.A. is not liable for any consequence related to the
use of the provided software.
Date: 22nd April 2003
Copyright (C) 2002 Jean-Marc Valin
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
- Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
- Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
- Neither the name of the Xiph.org Foundation nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
| Field Summary | |
|---|---|
static int |
CONTAINER_FORMAT_OGG
Global identifier for when the container speex file is ogg. |
static int |
CONTAINER_FORMAT_WAV
Global identifier for when the container speex file is wav. |
| Constructor Summary | |
|---|---|
CodecJSpeex()
Constructor: Grabs a handle to the logger. |
|
| Method Summary | |
|---|---|
void |
cleanup()
Closes the audio stream and remove references to all instantiated objects. |
boolean |
endOfStream()
Returns false if there is still more data available to be read in. |
javax.sound.sampled.AudioFormat |
getAudioFormat()
Returns the audio format of the data being returned by the read() and readAll() methods. |
static int |
getSourceFormat()
Indicates the format of the containing file (ogg or wav). |
boolean |
initialize(java.net.URL url)
Prepares an audio stream to read from. |
boolean |
initialized()
Returns false if the stream is busy initializing. |
SoundBuffer |
read()
Reads in one stream buffer worth of audio data. |
SoundBuffer |
readAll()
Reads in all the audio data from the stream (up to the default "maximum file size". |
void |
reverseByteOrder(boolean b)
This method is ignored by CodecJSpeex, because it produces "nice" data. |
static void |
setSourceFormat(int format)
Tells the codec what format of the containing file is in (ogg or wav). |
static java.lang.String |
version()
Returns the version of JSpeex being used. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final int CONTAINER_FORMAT_OGG
public static final int CONTAINER_FORMAT_WAV
| Constructor Detail |
|---|
public CodecJSpeex()
| Method Detail |
|---|
public void reverseByteOrder(boolean b)
reverseByteOrder in interface ICodecb - True if the calling audio library requires byte-reversal from certain codecspublic boolean initialize(java.net.URL url)
initialize in interface ICodecurl - URL to an audio file to stream from.
public boolean initialized()
initialized in interface ICodecpublic SoundBuffer read()
SoundSystemConfig for more
information about accessing and changing default settings.
read in interface ICodecpublic SoundBuffer readAll()
SoundSystemConfig for more
information about accessing and changing default settings.
readAll in interface ICodecpublic boolean endOfStream()
endOfStream in interface ICodecpublic void cleanup()
cleanup in interface ICodecpublic javax.sound.sampled.AudioFormat getAudioFormat()
getAudioFormat in interface ICodecpublic static java.lang.String version()
public static void setSourceFormat(int format)
format - Global format identifier.public static int getSourceFormat()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||