javazoom.jl.decoder
Class SampleBuffer

java.lang.Object
  extended by javazoom.jl.decoder.Obuffer
      extended by javazoom.jl.decoder.SampleBuffer

public class SampleBuffer
extends Obuffer

The SampleBuffer class implements an output buffer that provides storage for a fixed size block of samples.


Field Summary
 
Fields inherited from class javazoom.jl.decoder.Obuffer
MAXCHANNELS, OBUFFERSIZE
 
Constructor Summary
SampleBuffer(int sample_frequency, int number_of_channels)
          Constructor
 
Method Summary
 void append(int channel, short value)
          Takes a 16 Bit PCM sample.
 void appendSamples(int channel, float[] f)
          Accepts 32 new PCM samples.
 void clear_buffer()
          Clears all data in the buffer (for seeking).
 void close()
           
 short[] getBuffer()
           
 int getBufferLength()
           
 int getChannelCount()
           
 int getSampleFrequency()
           
 void set_stop_flag()
          Notify the buffer that the user has stopped the stream.
 void write_buffer(int val)
          Write the samples to the file (Random Acces).
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SampleBuffer

public SampleBuffer(int sample_frequency,
                    int number_of_channels)
Constructor

Method Detail

getChannelCount

public int getChannelCount()

getSampleFrequency

public int getSampleFrequency()

getBuffer

public short[] getBuffer()

getBufferLength

public int getBufferLength()

append

public void append(int channel,
                   short value)
Takes a 16 Bit PCM sample.

Specified by:
append in class Obuffer

appendSamples

public void appendSamples(int channel,
                          float[] f)
Description copied from class: Obuffer
Accepts 32 new PCM samples.

Overrides:
appendSamples in class Obuffer

write_buffer

public void write_buffer(int val)
Write the samples to the file (Random Acces).

Specified by:
write_buffer in class Obuffer

close

public void close()
Specified by:
close in class Obuffer

clear_buffer

public void clear_buffer()
Description copied from class: Obuffer
Clears all data in the buffer (for seeking).

Specified by:
clear_buffer in class Obuffer

set_stop_flag

public void set_stop_flag()
Description copied from class: Obuffer
Notify the buffer that the user has stopped the stream.

Specified by:
set_stop_flag in class Obuffer


JavaZOOM 1999-2008