A sound input stream. More...
|virtual unsigned int||fetchSamples (boost::int16_t *to, unsigned int nSamples)=0|
|Fetch the given amount of samples, non-blocking and thread-safe. |
|virtual unsigned int||samplesFetched () const =0|
|Return number of samples fetched from this stream. |
|virtual bool||eof () const =0|
|Return true if there'll be no more data to fetch. |
A sound input stream.
Instance of this class are sounds you can pull samples from.
The format of the samples you pull is expected to be PCM samples as signed 16bit values in system-endian format.
It is expected that consecutive samples fetched are one for left and one for right stereo channel, in that order (even indexes for left channel, odd indexes for right channel).
Instances of this class would be the input for the gnash Mixer (currently sound_handler) instance.
|virtual bool gnash::sound::InputStream::eof||(||)|| const
|virtual unsigned int gnash::sound::InputStream::fetchSamples||(||boost::int16_t *||to,|
Fetch the given amount of samples, non-blocking and thread-safe.
|to||Output buffer, must be at least nSamples*bytes. (or nSamples items sized, being a container of 16bit values).|
|nSamples||Number of samples to fetch. It is expected that the fetcher fetches samples in multiples of 2, being each couple composed by a sample for the left channel and a sample for the right channel, in that order.|
|a||SoundException (to be better defined a set of them) if unable to process this and further requests due to internal errors (not if it just happens to complete its source)|
Referenced by gnash::sound::sound_handler::fetchSamples().
|virtual unsigned int gnash::sound::InputStream::samplesFetched||(||)|| const
Return number of samples fetched from this stream.
It is expected for the return to be always a multiple of 2, being each stereo sample unit composed by a sample for the left channel and a sample for the right channel, in that order.