Gnash  0.8.11dev
Public Member Functions | List of all members
gnash::media::SoundInfo Class Reference

Class containing information about an embedded sound definition. More...

#include <SoundInfo.h>

Public Member Functions

 SoundInfo (audioCodecType format, bool stereo, std::uint32_t sampleRate, std::uint32_t sampleCount, bool is16bit, std::int16_t delaySeek=0)
 Constructor. More...
 
audioCodecType getFormat () const
 Returns the format of the sound. More...
 
bool isStereo () const
 Returns the stereo status of the sound. More...
 
unsigned long getSampleRate () const
 Returns the samplerate of the sound. More...
 
unsigned long getSampleCount () const
 Returns the samplecount of the sound. More...
 
std::int16_t getDelaySeek () const
 Return the number of samples to seek forward or delay. More...
 
bool is16bit () const
 Returns the 16bit status of the sound. More...
 

Detailed Description

Class containing information about an embedded sound definition.

Is created by the parser while parsing, and ownership is then transferred to EmbeddedSound. When the parser is parsing streams, it will ask the soundhandler for this to know what properties the stream has.

Constructor & Destructor Documentation

§ SoundInfo()

gnash::media::SoundInfo::SoundInfo ( audioCodecType  format,
bool  stereo,
std::uint32_t  sampleRate,
std::uint32_t  sampleCount,
bool  is16bit,
std::int16_t  delaySeek = 0 
)
inline

Constructor.

Parameters
formatThe encoding/format of this sound.
stereoDefines whether the sound is in stereo.
sampleRateThe sample rate of the sound.
sampleCountThe sample count in the sound. In soundstreams this is an average for each frame.
is16bitIf true, the sound is in 16bit format (samplesize == 2) else it is 8bit (samplesize == 1). Used for streams when decoding adpcm.
delaySeekNumber of samples to seek forward or delay. If this value is positive, the player seeks this number of samples into the sound block before the sound is played. If this value is negative the player plays this number of silent samples before playing the sound block NOTE that this value refers to input samples, so must be multiplied by OUTPUT_SAMPLE_RATE/getSampleRate() and by 2 (two channels) to find number of output samples to skip or fill.

Member Function Documentation

§ getDelaySeek()

std::int16_t gnash::media::SoundInfo::getDelaySeek ( ) const
inline

Return the number of samples to seek forward or delay.

The number is to be considered in pre-resampling units.

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

§ getFormat()

audioCodecType gnash::media::SoundInfo::getFormat ( ) const
inline

§ getSampleCount()

unsigned long gnash::media::SoundInfo::getSampleCount ( ) const
inline

Returns the samplecount of the sound.

This is the amount of samples you'd get after successfully decoding the sound.

Returns
the samplecount of the sound

Referenced by gnash::sound::sound_handler::get_duration(), gnash::SWF::StreamSoundBlockTag::loader(), and gnash::media::AudioDecoderSimple::~AudioDecoderSimple().

§ getSampleRate()

unsigned long gnash::media::SoundInfo::getSampleRate ( ) const
inline

§ is16bit()

bool gnash::media::SoundInfo::is16bit ( ) const
inline

Returns the 16bit status of the sound.

Returns
the 16bit status of the sound

Referenced by gnash::sound::LiveSound::LiveSound(), and gnash::media::AudioDecoderSimple::~AudioDecoderSimple().

§ isStereo()

bool gnash::media::SoundInfo::isStereo ( ) const
inline

The documentation for this class was generated from the following file: