|
| | NullSoundHandler (media::MediaHandler *m, sound_handler *mixer=nullptr) |
| |
| void | mix (std::int16_t *outSamples, std::int16_t *inSamples, unsigned int nSamples, float volume) |
| | Mix nSamples from inSamples to outSamples, with given volume. More...
|
| |
Public Member Functions inherited from gnash::sound::sound_handler |
| virtual | ~sound_handler () |
| |
| virtual void | stop_all_sounds () |
| | Mixed functions: More...
|
| |
| virtual int | create_sound (std::unique_ptr< SimpleBuffer > data, const media::SoundInfo &sinfo) |
| | Event sound functions: More...
|
| |
| virtual void | stopEventSound (int sound_handle) |
| | Remove scheduled requests to play the specified sound buffer slot. More...
|
| |
| virtual void | stopAllEventSounds () |
| | Stop all instances of all playing event sounds. More...
|
| |
| virtual void | delete_sound (int sound_handle) |
| | Discard the sound data for an embedded event sound. More...
|
| |
| void | startSound (int id, int loops, const SoundEnvelopes *env, bool allowMultiple, unsigned int inPoint=0, unsigned int outPoint=std::numeric_limits< unsigned int >::max()) |
| | Start playback of an event sound. More...
|
| |
| bool | isSoundPlaying (int id) const |
| | Check if an event sound is playing. More...
|
| |
| virtual void | set_volume (int sound_handle, int volume) |
| | Sets the volume for a given event sound. More...
|
| |
| virtual unsigned int | get_duration (int sound_handle) const |
| | Gets the duration in milliseconds of an event sound. More...
|
| |
| virtual unsigned int | tell (int sound_handle) const |
| | Gets the playhead position in milliseconds of an event sound. More...
|
| |
| virtual int | get_volume (int sound_handle) const |
| | Gets the volume for a given sound buffer slot. More...
|
| |
| virtual int | createStreamingSound (const media::SoundInfo &sinfo) |
| | Streaming sound functions: More...
|
| |
| virtual void | stopStreamingSound (int handle) |
| | Remove scheduled requests to play the specified sound buffer slot. More...
|
| |
| virtual StreamBlockId | addSoundBlock (SimpleBuffer data, size_t sampleCount, int seekSamples, int streamId) |
| |
| virtual media::SoundInfo * | get_sound_info (int handle) const |
| | Returns a SoundInfo object for the sound with the given id. More...
|
| |
| void | playStream (int handle, StreamBlockId blockId) |
| | Start playback of a streaming sound, if not playing already. More...
|
| |
| int | getStreamBlock (int handle) const |
| | Get the identifier for the block playing in a specific stream. More...
|
| |
| int | getFinalVolume () const |
| | Sound output functions. More...
|
| |
| void | setFinalVolume (int v) |
| | Set the volume to apply to mixed output. More...
|
| |
| virtual void | reset () |
| | Discard all sound inputs (slots and aux streamers) and clear scheduling. More...
|
| |
| void | mute () |
| | Call this to mute audio. More...
|
| |
| void | unmute () |
| | Call this to unmute audio. More...
|
| |
| bool | is_muted () const |
| | Returns whether or not sound is muted. More...
|
| |
| virtual void | pause () |
| | gnash calls this to pause audio More...
|
| |
| virtual void | unpause () |
| | gnash calls this to unpause audio More...
|
| |
| bool | isPaused () const |
| | return true if audio is paused More...
|
| |
| virtual InputStream * | attach_aux_streamer (aux_streamer_ptr ptr, void *udata) |
| | Plug an external InputStream into the mixer. More...
|
| |
| virtual void | unplugInputStream (InputStream *id) |
| | Unplug an external InputStream from the mixer. More...
|
| |
| size_t | numSoundsStarted () const |
| | Special test-fuction. Reports how many times a sound has been started. More...
|
| |
| size_t | numSoundsStopped () const |
| | Special test-fuction. Reports how many times a sound has been stopped. More...
|
| |
| virtual void | fetchSamples (std::int16_t *to, unsigned int nSamples) |
| | Fetch mixed samples. More...
|
| |
| void | setAudioDump (const std::string &wavefile) |
| | Request to dump audio to the given filename. More...
|
| |
| bool | streamingSound () const |
| | Check if a streaming sound is playing. More...
|
| |
Null sound_handler, for testing or manual fetching of samples.
| void gnash::sound::NullSoundHandler::mix |
( |
std::int16_t * |
outSamples, |
|
|
std::int16_t * |
inSamples, |
|
|
unsigned int |
nSamples, |
|
|
float |
volume |
|
) |
| |
|
inlinevirtual |
Mix nSamples from inSamples to outSamples, with given volume.
- Parameters
-
| outSamples | The output samples buffer, to mix to. Must be big enough to contain nSamples. Can be larger. |
| inSamples | The input samples buffer, to mix in. It is non-const as this method is allowed to mess with content, for example to apply volume. TODO: why not applying volume upstream ?! |
| nSamples | The amount of samples to mix in. |
| volume | The volume to apply to input samples, as a fraction (0..1) |
TODO: this interface says nothing about how many channels we're going to mix. It should, to be a sane interface. Maybe, a Mixer instance should be created, initialized with number of channels, at each fetching.
Reimplemented from gnash::sound::sound_handler.
References gnash::sound::sound_handler::mix().