Gnash  0.8.10
Classes | Typedefs | Functions
gnash::sound Namespace Reference

Gnash sound handling subsystem (libsound) More...

Classes

class  AOS4_sound_handler
 AHI-based sound_handler. More...
class  AuxStream
class  EmbedSound
 Definition of an embedded sound. More...
class  EmbedSoundInst
 Instance of a defined sound (EmbedSound) More...
class  InputStream
 A sound input stream. More...
class  LiveSound
 Instance of a defined sound (LiveSoundData) More...
class  Mkit_sound_handler
 Mkit media kit based sound_handler. More...
class  NullSoundHandler
 Null sound_handler, for testing or manual fetching of samples. More...
class  SDL_sound_handler
 SDL-based sound_handler. More...
class  sound_handler
 Sound mixer. More...
class  SoundEnvelope
 A sound envelope. More...
class  StreamingSound
 Instance of a defined sound (StreamingSoundData) More...
class  StreamingSoundData
 Definition of an embedded sound. More...
class  WAVWriter
 WAV writer class. More...

Typedefs

typedef unsigned int(* aux_streamer_ptr )(void *udata, boost::int16_t *samples, unsigned int nSamples, bool &eof)
typedef std::vector
< SoundEnvelope
SoundEnvelopes
 A vector of SoundEnvelope objects.

Functions

sound_handlercreate_sound_handler_aos4 (media::MediaHandler *m)
sound_handlercreate_sound_handler_mkit (media::MediaHandler *m)
sound_handlercreate_sound_handler_sdl (media::MediaHandler *m)
template<typename T >
void adjustVolume (T *start, T *end, float volume)
 Volume adjustment.
size_t swfToOutSamples (const media::SoundInfo &sinfo, size_t swfSamples, const size_t outRate=44100)
 Convert SWF-specified number of samples to output number of samples.

Detailed Description

Gnash sound handling subsystem (libsound)

This subsystem takes care of mixing audio and communicating to the system mixer.


Typedef Documentation

typedef unsigned int(* gnash::sound::aux_streamer_ptr)(void *udata, boost::int16_t *samples, unsigned int nSamples, bool &eof)

A vector of SoundEnvelope objects.


Function Documentation

template<typename T >
void gnash::sound::adjustVolume ( T *  start,
T *  end,
float  volume 
) [inline]

Volume adjustment.

Parameters:
startThe beginning of the range to adjust volume for
endThe end of the range to adjust volume for
volumeVolume factor

References gnash::key::_1.

sound_handler* gnash::sound::create_sound_handler_aos4 ( media::MediaHandler *  m)
sound_handler* gnash::sound::create_sound_handler_mkit ( media::MediaHandler *  m)
sound_handler* gnash::sound::create_sound_handler_sdl ( media::MediaHandler *  m)
size_t gnash::sound::swfToOutSamples ( const media::SoundInfo &  sinfo,
size_t  swfSamples,
const size_t  outRate = 44100 
) [inline]

Convert SWF-specified number of samples to output number of samples.

SWF-specified number of samples are: delaySeek in DEFINESOUND, latency in STREAMSOUNDHEAD and seekSamples in STREAMSOUNDBLOCK. These refer to samples at the sampleRate of input.

As gnash will resample the sounds to match expected output (44100 Hz, stereo 16bit) this function is handy to convert for simpler use later.

References gnash::media::SoundInfo::getSampleRate().

Referenced by gnash::sound::sound_handler::startSound().