uk.org.toot.audio.core
Class AudioBuffer

java.lang.Object
  extended by org.tritonus.share.sampled.FloatSampleBuffer
      extended by uk.org.toot.audio.core.AudioBuffer

public class AudioBuffer
extends org.tritonus.share.sampled.FloatSampleBuffer

Encapsulates buffered multi-channel sampled audio. It has a ChannelFormat and enables meta information to be attached to buffers. It can convert to another ChannelFormat (1->N and N->1 only) It has a real-time property to allow AudioProcesses to discriminate between real-time and non-real-time for quality purposes etc.

See Also:
It can swap channel pairs.

Nested Class Summary
static class AudioBuffer.MetaInfo
          MetaInfo holds meta information for an AudioBuffer.
 
Field Summary
 
Fields inherited from class org.tritonus.share.sampled.FloatSampleBuffer
DITHER_MODE_AUTOMATIC, DITHER_MODE_OFF, DITHER_MODE_ON
 
Constructor Summary
AudioBuffer(java.lang.String name, int channelCount, int sampleCount, float sampleRate)
           
 
Method Summary
 void convertTo(ChannelFormat format)
           
 ChannelFormat getChannelFormat()
          Guesses format if unset.
 AudioBuffer.MetaInfo getMetaInfo()
           
 java.lang.String getName()
           
 boolean isRealTime()
          This method may be used by an AudioProcess to determine whether it can use high quality algorithms that would be impossible in real-time.
 void setChannelFormat(ChannelFormat format)
          May call setChannelCount accordingly
 void setMetaInfo(AudioBuffer.MetaInfo info)
           
 void setRealTime(boolean realTime)
          This method is intended for use by uk.org.toot.audio.server.NonRealTimeAudioServer No good will come from you calling it.
 void swap(int a, int b)
           
 
Methods inherited from class org.tritonus.share.sampled.FloatSampleBuffer
addChannel, changeSampleCount, checkFormatSupported, convertToByteArray, convertToByteArray, convertToByteArray, copy, copy, copyChannel, copyChannel, copyTo, copyTo, expandChannel, getAllChannels, getByteArrayBufferSize, getByteArrayBufferSize, getChannel, getChannelCount, getDitherBits, getDitherMode, getSampleCount, getSampleRate, init, init, initFromByteArray, initFromByteArray, initFromFloatSampleBuffer, insertChannel, insertChannel, linearFade, linearFade, linearFade, makeSilence, makeSilence, makeSilence, makeSilence, mix, mix, mixDownChannels, removeChannel, removeChannel, reset, reset, setDitherBits, setDitherMode, setRawChannel, setSampleCount, setSampleRate, setSamplesFromBytes, writeByteBuffer
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AudioBuffer

public AudioBuffer(java.lang.String name,
                   int channelCount,
                   int sampleCount,
                   float sampleRate)
Method Detail

getName

public java.lang.String getName()

setMetaInfo

public void setMetaInfo(AudioBuffer.MetaInfo info)

getMetaInfo

public AudioBuffer.MetaInfo getMetaInfo()

isRealTime

public boolean isRealTime()
This method may be used by an AudioProcess to determine whether it can use high quality algorithms that would be impossible in real-time. If it's not in real-time an AudioProcess may take as long as it needs.


setRealTime

public void setRealTime(boolean realTime)
This method is intended for use by uk.org.toot.audio.server.NonRealTimeAudioServer No good will come from you calling it.


getChannelFormat

public ChannelFormat getChannelFormat()
Guesses format if unset.


setChannelFormat

public void setChannelFormat(ChannelFormat format)
May call setChannelCount accordingly


convertTo

public void convertTo(ChannelFormat format)

swap

public void swap(int a,
                 int b)


Copyright © 2004, 2005, 2006, 2007 Steve Taylor. All Rights Reserved.