audiere Namespace Reference


Classes

class  RefCounted
class  RefPtr
class  RefImplementation
class  File
class  SampleSource
class  LoopPointSource
class  OutputStream
class  Event
 Base interface for event-specific data passed to callbacks. More...
class  StopEvent
class  Callback
class  StopCallback
class  AudioDevice
class  SampleBuffer
class  SoundEffect
class  CDDevice
class  MIDIStream
class  MIDIDevice
struct  FileFormatDesc
 Describes a file format that Audiere supports. More...
struct  AudioDeviceDesc
 Describes a supported audio device. More...

Namespaces

namespace  hidden

Typedefs

typedef RefPtr< FileFilePtr
typedef RefPtr< SampleSourceSampleSourcePtr
typedef RefPtr< LoopPointSourceLoopPointSourcePtr
typedef RefPtr< OutputStreamOutputStreamPtr
typedef RefPtr< EventEventPtr
typedef RefPtr< StopEventStopEventPtr
typedef RefPtr< CallbackCallbackPtr
typedef RefPtr< StopCallbackStopCallbackPtr
typedef RefPtr< AudioDeviceAudioDevicePtr
typedef RefPtr< SampleBufferSampleBufferPtr
typedef RefPtr< SoundEffectSoundEffectPtr
typedef RefPtr< CDDeviceCDDevicePtr
typedef RefPtr< MIDIStreamMIDIStreamPtr
typedef RefPtr< MIDIDeviceMIDIDevicePtr

Enumerations

enum  SampleFormat { SF_U8, SF_S16 }
enum  FileFormat {
  FF_AUTODETECT, FF_WAV, FF_OGG, FF_FLAC,
  FF_MP3, FF_MOD, FF_AIFF, FF_SPEEX
}
enum  EventType { ET_STOP }
enum  SoundEffectType { SINGLE, MULTIPLE }

Functions

template<typename T, typename U>
bool operator== (const RefPtr< T > &a, const RefPtr< U > &b)
template<typename T>
bool operator== (const RefPtr< T > &a, const T *b)
template<typename T>
bool operator== (const T *a, const RefPtr< T > &b)
template<typename T, typename U>
bool operator!= (const RefPtr< T > &a, const RefPtr< U > &b)
template<typename T>
bool operator!= (const RefPtr< T > &a, const T *b)
template<typename T>
bool operator!= (const T *a, const RefPtr< T > &b)
const char * GetVersion ()
void SplitString (std::vector< std::string > &out, const char *in, char delim)
void GetSupportedFileFormats (std::vector< FileFormatDesc > &formats)
void GetSupportedAudioDevices (std::vector< AudioDeviceDesc > &devices)
int GetSampleSize (SampleFormat format)
AudioDeviceOpenDevice (const char *name=0, const char *parameters=0)
SampleSourceOpenSampleSource (const char *filename, FileFormat file_format=FF_AUTODETECT)
SampleSourceOpenSampleSource (const FilePtr &file, FileFormat file_format=FF_AUTODETECT)
SampleSourceCreateTone (double frequency)
SampleSourceCreateSquareWave (double frequency)
SampleSourceCreateWhiteNoise ()
SampleSourceCreatePinkNoise ()
LoopPointSourceCreateLoopPointSource (const SampleSourcePtr &source)
LoopPointSourceCreateLoopPointSource (const char *filename, FileFormat file_format=FF_AUTODETECT)
LoopPointSourceCreateLoopPointSource (const FilePtr &file, FileFormat file_format=FF_AUTODETECT)
OutputStreamOpenSound (const AudioDevicePtr &device, const SampleSourcePtr &source, bool streaming=false)
OutputStreamOpenSound (const AudioDevicePtr &device, const char *filename, bool streaming=false, FileFormat file_format=FF_AUTODETECT)
OutputStreamOpenSound (const AudioDevicePtr &device, const FilePtr &file, bool streaming=false, FileFormat file_format=FF_AUTODETECT)
SampleBufferCreateSampleBuffer (void *samples, int frame_count, int channel_count, int sample_rate, SampleFormat sample_format)
SampleBufferCreateSampleBuffer (const SampleSourcePtr &source)
SoundEffectOpenSoundEffect (const AudioDevicePtr &device, const SampleSourcePtr &source, SoundEffectType type)
SoundEffectOpenSoundEffect (const AudioDevicePtr &device, const char *filename, SoundEffectType type, FileFormat file_format=FF_AUTODETECT)
SoundEffectOpenSoundEffect (const AudioDevicePtr &device, const FilePtr &file, SoundEffectType type, FileFormat file_format=FF_AUTODETECT)
FileOpenFile (const char *filename, bool writeable)
FileCreateMemoryFile (const void *buffer, int size)
void EnumerateCDDevices (std::vector< std::string > &devices)
CDDeviceOpenCDDevice (const char *device)
MIDIDeviceOpenMIDIDevice (const char *device)


Typedef Documentation

typedef RefPtr<AudioDevice> audiere::AudioDevicePtr
 

Definition at line 774 of file audiere.h.

typedef RefPtr<Callback> audiere::CallbackPtr
 

Definition at line 656 of file audiere.h.

typedef RefPtr<CDDevice> audiere::CDDevicePtr
 

Definition at line 967 of file audiere.h.

typedef RefPtr<Event> audiere::EventPtr
 

Definition at line 603 of file audiere.h.

typedef RefPtr<File> audiere::FilePtr
 

Definition at line 273 of file audiere.h.

typedef RefPtr<LoopPointSource> audiere::LoopPointSourcePtr
 

Definition at line 467 of file audiere.h.

typedef RefPtr<MIDIDevice> audiere::MIDIDevicePtr
 

Definition at line 1039 of file audiere.h.

typedef RefPtr<MIDIStream> audiere::MIDIStreamPtr
 

Definition at line 1012 of file audiere.h.

typedef RefPtr<OutputStream> audiere::OutputStreamPtr
 

Definition at line 585 of file audiere.h.

typedef RefPtr<SampleBuffer> audiere::SampleBufferPtr
 

Definition at line 819 of file audiere.h.

typedef RefPtr<SampleSource> audiere::SampleSourcePtr
 

Definition at line 399 of file audiere.h.

typedef RefPtr<SoundEffect> audiere::SoundEffectPtr
 

Definition at line 896 of file audiere.h.

typedef RefPtr<StopCallback> audiere::StopCallbackPtr
 

Definition at line 685 of file audiere.h.

typedef RefPtr<StopEvent> audiere::StopEventPtr
 

Definition at line 633 of file audiere.h.


Enumeration Type Documentation

enum audiere::EventType
 

An integral code representing a specific type of event.

Enumerator:
ET_STOP  See StopEvent and StopCallback.

Definition at line 589 of file audiere.h.

enum audiere::FileFormat
 

Supported audio file formats.

Enumerator:
FF_AUTODETECT 
FF_WAV 
FF_OGG 
FF_FLAC 
FF_MP3 
FF_MOD 
FF_AIFF 
FF_SPEEX 

Definition at line 284 of file audiere.h.

enum audiere::SampleFormat
 

Storage formats for sample data.

Enumerator:
SF_U8  unsigned 8-bit integer [0,255]
SF_S16  signed 16-bit integer in host endianness [-32768,32767]

Definition at line 277 of file audiere.h.

enum audiere::SoundEffectType
 

Defines the type of SoundEffect objects.

See also:
SoundEffect
Enumerator:
SINGLE 
MULTIPLE 

Definition at line 825 of file audiere.h.


Function Documentation

LoopPointSource* audiere::CreateLoopPointSource const FilePtr file,
FileFormat  file_format = FF_AUTODETECT
[inline]
 

Creates a LoopPointSource from a source loaded from a file.

Definition at line 1339 of file audiere.h.

References CreateLoopPointSource(), and OpenSampleSource().

LoopPointSource* audiere::CreateLoopPointSource const char *  filename,
FileFormat  file_format = FF_AUTODETECT
[inline]
 

Creates a LoopPointSource from a source loaded from a file.

Definition at line 1329 of file audiere.h.

References CreateLoopPointSource(), and OpenSampleSource().

LoopPointSource* audiere::CreateLoopPointSource const SampleSourcePtr source  )  [inline]
 

Create a LoopPointSource from a SampleSource. The SampleSource must be seekable. If it isn't, or the source isn't valid, this function returns 0.

Definition at line 1320 of file audiere.h.

References audiere::hidden::AdrCreateLoopPointSource(), and audiere::RefPtr< T >::get().

Referenced by CreateLoopPointSource().

File* audiere::CreateMemoryFile const void *  buffer,
int  size
[inline]
 

Creates a File implementation that reads from a buffer in memory. It stores a copy of the buffer that is passed in.

The File object does not take ownership of the memory buffer. When the file is destroyed, it will not free the memory.

Parameters:
buffer Pointer to the beginning of the data.
size Size of the buffer in bytes.
Returns:
0 if size is non-zero and buffer is null. Otherwise, returns a valid File object.

Definition at line 1522 of file audiere.h.

References audiere::hidden::AdrCreateMemoryFile().

SampleSource* audiere::CreatePinkNoise  )  [inline]
 

Create a pink noise sample source. Pink noise is noise with equal power distribution among octaves (logarithmic), not frequencies.

Returns:
pink noise sample source

Definition at line 1311 of file audiere.h.

References audiere::hidden::AdrCreatePinkNoise().

SampleBuffer* audiere::CreateSampleBuffer const SampleSourcePtr source  )  [inline]
 

Create a SampleBuffer object from a SampleSource.

Parameters:
source Seekable sample source used to create the buffer. If the source is not seekable, then the function fails.
Returns:
new sample buffer if success, 0 otherwise

Definition at line 1445 of file audiere.h.

References audiere::hidden::AdrCreateSampleBufferFromSource(), and audiere::RefPtr< T >::get().

SampleBuffer* audiere::CreateSampleBuffer void *  samples,
int  frame_count,
int  channel_count,
int  sample_rate,
SampleFormat  sample_format
[inline]
 

Create a SampleBuffer object using the specified samples and formats.

Parameters:
samples Pointer to a buffer of samples used to initialize the new object. If this is 0, the sample buffer contains just silence.
frame_count Size of the sample buffer in frames.
channel_count Number of channels in each frame.
sample_rate Sample rate in Hz.
sample_format Format of each sample.
See also:
SampleFormat.
Returns:
new SampleBuffer object

Definition at line 1424 of file audiere.h.

References audiere::hidden::AdrCreateSampleBuffer().

SampleSource* audiere::CreateSquareWave double  frequency  )  [inline]
 

Create a square wave with the specified frequency.

Parameters:
frequency Frequency of the wave in Hz.
Returns:
wave sample source

Definition at line 1291 of file audiere.h.

References audiere::hidden::AdrCreateSquareWave().

SampleSource* audiere::CreateTone double  frequency  )  [inline]
 

Create a tone sample source with the specified frequency.

Parameters:
frequency Frequency of the tone in Hz.
Returns:
tone sample source

Definition at line 1280 of file audiere.h.

References audiere::hidden::AdrCreateTone().

SampleSource* audiere::CreateWhiteNoise  )  [inline]
 

Create a white noise sample source. White noise is just random data.

Returns:
white noise sample source

Definition at line 1301 of file audiere.h.

References audiere::hidden::AdrCreateWhiteNoise().

void audiere::EnumerateCDDevices std::vector< std::string > &  devices  )  [inline]
 

Generates a list of available CD device names.

Parameters:
devices A vector of strings to be filled.

Definition at line 1531 of file audiere.h.

References audiere::hidden::AdrEnumerateCDDevices().

int audiere::GetSampleSize SampleFormat  format  )  [inline]
 

Get the size of a sample in a specific sample format. This is commonly used to determine how many bytes a chunk of PCM data will take.

Returns:
Number of bytes a single sample in the specified format takes.

Definition at line 1217 of file audiere.h.

References audiere::hidden::AdrGetSampleSize().

void audiere::GetSupportedAudioDevices std::vector< AudioDeviceDesc > &  devices  )  [inline]
 

Populates a vector of AudioDeviceDesc structs.

Definition at line 1195 of file audiere.h.

References audiere::hidden::AdrGetSupportedAudioDevices(), and SplitString().

void audiere::GetSupportedFileFormats std::vector< FileFormatDesc > &  formats  )  [inline]
 

Populates a vector of FileFormatDesc structs.

Definition at line 1170 of file audiere.h.

References audiere::hidden::AdrGetSupportedFileFormats(), and SplitString().

const char* audiere::GetVersion  )  [inline]
 

Returns the Audiere version string.

Returns:
Audiere version information

Definition at line 1136 of file audiere.h.

References audiere::hidden::AdrGetVersion().

CDDevice* audiere::OpenCDDevice const char *  device  )  [inline]
 

Opens the specified CD playback device.

Parameters:
device The filesystem device to be played. e.g. Linux: "/dev/cdrom", Windows: "D:"
Returns:
0 if opening device failed, valid CDDrive object otherwise.

Definition at line 1547 of file audiere.h.

References audiere::hidden::AdrOpenCDDevice().

AudioDevice* audiere::OpenDevice const char *  name = 0,
const char *  parameters = 0
[inline]
 

Open a new audio device. If name or parameters are not specified, defaults are used. Each platform has its own set of audio devices. Every platform supports the "null" audio device.

Parameters:
name name of audio device that should be used
parameters comma delimited list of audio-device parameters; for example, "buffer=100,rate=44100"
Returns:
new audio device object if OpenDevice succeeds, and 0 in case of failure

Definition at line 1233 of file audiere.h.

References audiere::hidden::AdrOpenDevice().

File* audiere::OpenFile const char *  filename,
bool  writeable
[inline]
 

Opens a default file implementation from the local filesystem.

Parameters:
filename The name of the file on the local filesystem.
writeable Whether the writing to the file is allowed.

Definition at line 1505 of file audiere.h.

References audiere::hidden::AdrOpenFile().

MIDIDevice* audiere::OpenMIDIDevice const char *  device  )  [inline]
 

Opens the specified MIDI synthesizer device.

Parameters:
device The name of the device. Unused for now.
Returns:
0 if opening device failed, valid MIDIDevice object otherwise.

Definition at line 1558 of file audiere.h.

References audiere::hidden::AdrOpenMIDIDevice().

SampleSource* audiere::OpenSampleSource const FilePtr file,
FileFormat  file_format = FF_AUTODETECT
[inline]
 

Opens a sample source from the specified file object. If the sound file cannot be opened, this factory function returns 0.

Note:
Some sound files support seeking, while some don't.
Parameters:
file File object from which to open the decoder
file_format Format of the file to load. If FF_AUTODETECT, Audiere will try opening the file in each format.
Returns:
new SampleSource if OpenSampleSource succeeds, 0 otherwise

Definition at line 1266 of file audiere.h.

References audiere::hidden::AdrOpenSampleSourceFromFile(), and audiere::RefPtr< T >::get().

SampleSource* audiere::OpenSampleSource const char *  filename,
FileFormat  file_format = FF_AUTODETECT
[inline]
 

Create a streaming sample source from a sound file. This factory simply opens a default file from the system filesystem and calls OpenSampleSource(File*).

See also:
OpenSampleSource(File*)

Definition at line 1247 of file audiere.h.

References audiere::hidden::AdrOpenSampleSource().

Referenced by CreateLoopPointSource(), OpenSound(), and OpenSoundEffect().

OutputStream* audiere::OpenSound const AudioDevicePtr device,
const FilePtr file,
bool  streaming = false,
FileFormat  file_format = FF_AUTODETECT
[inline]
 

Calls OpenSound(AudioDevice*, SampleSource*) with a sample source created via OpenSampleSource(File* file).

Definition at line 1397 of file audiere.h.

References OpenSampleSource(), and OpenSound().

OutputStream* audiere::OpenSound const AudioDevicePtr device,
const char *  filename,
bool  streaming = false,
FileFormat  file_format = FF_AUTODETECT
[inline]
 

Calls OpenSound(AudioDevice*, SampleSource*) with a sample source created via OpenSampleSource(const char*).

Definition at line 1383 of file audiere.h.

References OpenSampleSource(), and OpenSound().

OutputStream* audiere::OpenSound const AudioDevicePtr device,
const SampleSourcePtr source,
bool  streaming = false
[inline]
 

Try to open a sound buffer using the specified AudioDevice and sample source. If the specified sample source is seekable, it loads it into memory and uses AudioDevice::openBuffer to create the output stream. If the stream is not seekable, it uses AudioDevice::openStream to create the output stream. This means that certain file types must always be streamed, and therefore, OpenSound will hold on to the file object. If you must guarantee that the file on disk is no longer referenced, you must create your own memory file implementation and load your data into that before calling OpenSound.

Parameters:
device AudioDevice in which to open the output stream.
source SampleSource used to generate samples for the sound object. OpenSound takes ownership of source, even if it returns 0. (In that case, OpenSound immediately deletes the SampleSource.)
streaming If false or unspecified, OpenSound attempts to open the entire sound into memory. Otherwise, it streams the sound from the file.
Returns:
new output stream if successful, 0 otherwise

Definition at line 1371 of file audiere.h.

References audiere::hidden::AdrOpenSound(), and audiere::RefPtr< T >::get().

Referenced by OpenSound().

SoundEffect* audiere::OpenSoundEffect const AudioDevicePtr device,
const FilePtr file,
SoundEffectType  type,
FileFormat  file_format = FF_AUTODETECT
[inline]
 

Calls OpenSoundEffect(AudioDevice*, SampleSource*, SoundEffectType) with a sample source created from the file.

Definition at line 1489 of file audiere.h.

References OpenSampleSource(), and OpenSoundEffect().

SoundEffect* audiere::OpenSoundEffect const AudioDevicePtr device,
const char *  filename,
SoundEffectType  type,
FileFormat  file_format = FF_AUTODETECT
[inline]
 

Calls OpenSoundEffect(AudioDevice*, SampleSource*, SoundEffectType) with a sample source created from the filename.

Definition at line 1475 of file audiere.h.

References OpenSampleSource(), and OpenSoundEffect().

SoundEffect* audiere::OpenSoundEffect const AudioDevicePtr device,
const SampleSourcePtr source,
SoundEffectType  type
[inline]
 

Open a SoundEffect object from the given sample source and sound effect type.

See also:
SoundEffect
Parameters:
device AudioDevice on which the sound is played.
source The sample source used to feed the sound effect with data.
type The type of the sound effect. If type is MULTIPLE, the source must be seekable.
Returns:
new SoundEffect object if successful, 0 otherwise

Definition at line 1463 of file audiere.h.

References audiere::hidden::AdrOpenSoundEffect(), and audiere::RefPtr< T >::get().

Referenced by OpenSoundEffect().

template<typename T>
bool audiere::operator!= const T *  a,
const RefPtr< T > &  b
 

Definition at line 183 of file audiere.h.

References audiere::RefPtr< T >::get().

template<typename T>
bool audiere::operator!= const RefPtr< T > &  a,
const T *  b
 

Definition at line 178 of file audiere.h.

References audiere::RefPtr< T >::get().

template<typename T, typename U>
bool audiere::operator!= const RefPtr< T > &  a,
const RefPtr< U > &  b
 

Definition at line 173 of file audiere.h.

References audiere::RefPtr< T >::get().

template<typename T>
bool audiere::operator== const T *  a,
const RefPtr< T > &  b
 

Definition at line 167 of file audiere.h.

References audiere::RefPtr< T >::get().

template<typename T>
bool audiere::operator== const RefPtr< T > &  a,
const T *  b
 

Definition at line 162 of file audiere.h.

References audiere::RefPtr< T >::get().

template<typename T, typename U>
bool audiere::operator== const RefPtr< T > &  a,
const RefPtr< U > &  b
 

Definition at line 157 of file audiere.h.

References audiere::RefPtr< T >::get().

void audiere::SplitString std::vector< std::string > &  out,
const char *  in,
char  delim
[inline]
 

Definition at line 1141 of file audiere.h.

Referenced by GetSupportedAudioDevices(), and GetSupportedFileFormats().


Generated on Mon Feb 13 23:07:15 2006 for audiere by  doxygen 1.4.6