Package com.jme3.audio.plugins
Class NativeVorbisFile
java.lang.Object
com.jme3.audio.plugins.NativeVorbisFile
Represents the android implementation for the native  vorbis file decoder.
 This decoder initializes an OggVorbis_File from an already opened file designated by the 
fd.- 
Field SummaryFieldsModifier and TypeFieldDescriptionintintfloatintintbooleanint
- 
Constructor SummaryConstructorsConstructorDescriptionNativeVorbisFile(int fd, long offset, long length) Initializes an ogg vorbis native file from a file descriptor [fd] of an already opened file.
- 
Method SummaryModifier and TypeMethodDescriptionvoidClears the native resources and destroys the bufferovfreference.intreadIntoArray(byte[] buffer, int offset, int length) Reads the vorbis file into a primitive byte buffer [buf] with an [offset] indicating the start byte and a [length] indicating the end byte on the output buffer.voidreadIntoBuffer(ByteBuffer out) Reads the vorbis file into a directByteBuffer, starting from offset [0] till the buffer end on the output buffer.voidseekTime(double time) Seeks to a playback time relative to the decompressed pcm (Pulse-code modulation) stream.
- 
Field Details- 
fdpublic int fd
- 
ovf
- 
seekablepublic boolean seekable
- 
channelspublic int channels
- 
sampleRatepublic int sampleRate
- 
bitRatepublic int bitRate
- 
totalBytespublic int totalBytes
- 
durationpublic float duration
 
- 
- 
Constructor Details- 
NativeVorbisFileInitializes an ogg vorbis native file from a file descriptor [fd] of an already opened file.- Parameters:
- fd- an integer representing the file descriptor
- offset- an integer indicating the start of the buffer
- length- an integer indicating the end of the buffer
- Throws:
- IOException- in cases of a failure to initialize the vorbis file
 
 
- 
- 
Method Details- 
seekTimeSeeks to a playback time relative to the decompressed pcm (Pulse-code modulation) stream.- Parameters:
- time- the playback seek time
- Throws:
- IOException- if the seek is not successful
 
- 
readIntoArrayReads the vorbis file into a primitive byte buffer [buf] with an [offset] indicating the start byte and a [length] indicating the end byte on the output buffer.- Parameters:
- buffer- a primitive byte buffer to read the data into it
- offset- an integer representing the offset or the start byte on the output buffer
- length- an integer representing the end byte on the output buffer
- Returns:
- the number of the read bytes, (-1) if the reading has failed indicating an EOF, returns (0) if the reading has failed or the primitive [buffer] passed is null
- Throws:
- IOException- if the library has failed to read the file into the [out] buffer or if the java primitive byte array [buffer] is inaccessible
 
- 
readIntoBufferReads the vorbis file into a directByteBuffer, starting from offset [0] till the buffer end on the output buffer.- Parameters:
- out- a reference to the output direct buffer
- Throws:
- IOException- if a premature EOF is encountered before reaching the end of the buffer or if the library has failed to read the file into the [out] buffer
 
- 
clearResourcespublic void clearResources()Clears the native resources and destroys the bufferovfreference.
 
-