Gateware Libraries  R6.5A
Beta Build
GW::AUDIO::GSound Class Referenceabstract
Inheritance diagram for GW::AUDIO::GSound:
Collaboration diagram for GW::AUDIO::GSound:

Public Member Functions

virtual GReturn SetChannelVolumes (float *_values, int _numChannels)=0
 Attempts to set the output volume for the specified number of outputs to the passed in values. More...
 
virtual GReturn SetVolume (float _newVolume)=0
 Attempts to change the overall volume. More...
 
virtual GReturn Play ()=0
 Attempts to playback a sound effect. More...
 
virtual GReturn Pause ()=0
 Attempts to pause a currently playing sound effect. More...
 
virtual GReturn Resume ()=0
 Attempts to resume a currently paused sound effect. More...
 
virtual GReturn StopSound ()=0
 Attempts to stop playback of sound effect and reset it to begining for future use. More...
 
virtual GReturn GetSoundSourceChannels (unsigned int &returnedChannelNum)=0
 Stores the .wav files internal amount of channels the sound was recorded with into the passed in unsigned int. More...
 
virtual GReturn GetSoundOutputChannels (unsigned int &returnedChannelNum)=0
 Stores the number of specified outputs into the passed in unsigned int. More...
 
virtual GReturn isSoundPlaying (bool &_returnedBool)=0
 Fills out the passed in bool with information as to if the sound thinks it is playing or not. More...
 
virtual GReturn GetCount (unsigned int &_outCount)=0
 Return the total number of active references to this object. More...
 
virtual GReturn IncrementCount ()=0
 Increase the total number of active references to this object. More...
 
virtual GReturn DecrementCount ()=0
 Decrease the total number of active references to this object. More...
 
virtual GReturn RequestInterface (const GUUIID &_interfaceID, void **_outputInterface)=0
 Requests an interface that may or may not be supported by this object. More...
 

Member Function Documentation

◆ DecrementCount()

virtual GReturn GW::AUDIO::GSound::DecrementCount ( )
pure virtual

Decrease the total number of active references to this object.

Once the internal count reaches zero this object will be deallocated and your pointer will become invalid.

Return values
SUCCESSSuccessfully decremented the internal reference count.
FAILUREDecrementing of internal reference count would underflow the value.

Implements GW::CORE::GInterface.

◆ GetCount()

virtual GReturn GW::AUDIO::GSound::GetCount ( unsigned int &  _outCount)
pure virtual

Return the total number of active references to this object.

Parameters
[out]_outCountThe total number of active references of this object.
Return values
SUCCESSAlways, boolean passed in will tell you if sound is playing or not.

Implements GW::CORE::GInterface.

◆ GetSoundOutputChannels()

virtual GReturn GW::AUDIO::GSound::GetSoundOutputChannels ( unsigned int &  returnedChannelNum)
pure virtual

Stores the number of specified outputs into the passed in unsigned int.

This value is obtained from the GAudio that created this sound effect. By default the number of output channels is 2 unless GAudio was created with a different amount.

Parameters
[out]Theunsigned int which will be stored with the value.
Return values
FAILUREGAudio has not filled it out this object with GAudio's fuunction: "CreateSound".
SUCCESSSuccessfully ran without running into any of the above issues.

◆ GetSoundSourceChannels()

virtual GReturn GW::AUDIO::GSound::GetSoundSourceChannels ( unsigned int &  returnedChannelNum)
pure virtual

Stores the .wav files internal amount of channels the sound was recorded with into the passed in unsigned int.

This value is read and stored upon creation of GSound.

Parameters
[out]Theunsigned int which will be stored with the value.
Return values
FAILUREGAudio has not filled it out this object with GAudio's fuunction: "CreateSound".
SUCCESSSuccessfully ran without running into any of the above issues.

◆ IncrementCount()

virtual GReturn GW::AUDIO::GSound::IncrementCount ( )
pure virtual

Increase the total number of active references to this object.

End users should only call this operation if they are familiar with reference counting behavior.

Return values
SUCCESSSuccessfully incremented the internal reference count.
FAILUREIncrementation of internal reference count would overflow the value.

Implements GW::CORE::GInterface.

◆ isSoundPlaying()

virtual GReturn GW::AUDIO::GSound::isSoundPlaying ( bool &  _returnedBool)
pure virtual

Fills out the passed in bool with information as to if the sound thinks it is playing or not.

GSound internally keeps track of whether or not it playing via the Play,Pause,Resume,Stop functions as well as if the buffer has finished playing.

Parameters
[out]Thebool which will be stored with the value.
Return values
FAILUREGAudio has not filled it out this object with GAudio's fuunction: "CreateSound".
SUCCESSAlways, boolean passed in will tell you if sound is playing or not.

◆ Pause()

virtual GReturn GW::AUDIO::GSound::Pause ( )
pure virtual

Attempts to pause a currently playing sound effect.

Currenntly only supports .wav files. GSound fully loads entire audio file into memory. If file is extremely large, consider using GMusic instead. If sound is currently paused, will not attempt to pause playback without returning an error.

Return values
FAILUREGAudio has not filled it out this object with GAudio's fuunction: "CreateSound".
FAILUREInternal Source voice is NULL - (which could happen if specified .wav file could not be found or encountered an error upon reading in data).
FAILUREIf internal object incounters an error. Unlikely to occur if GAudio's "CreateSound" did not return an error upon filling out this object.
SUCCESSSuccessfully ran without running into any of the above issues.

◆ Play()

virtual GReturn GW::AUDIO::GSound::Play ( )
pure virtual

Attempts to playback a sound effect.

Currenntly only supports .wav files. GSound fully loads entire audio file into memory. If file is extremely large, consider using GMusic instead. If sound is currently playing, will attempt to stop and restart playback.

Return values
FAILUREGAudio has not filled it out this object with GAudio's fuunction: "CreateSound".
FAILUREInternal Source voice is NULL - (which could happen if specified .wav file could not be found or encountered an error upon reading in data).
FAILUREIf internal object incounters an error. Unlikely to occur if GAudio's "CreateSound" did not return an error upon filling out this object.
SUCCESSSuccessfully ran without running into any of the above issues.

◆ RequestInterface()

virtual GReturn GW::AUDIO::GSound::RequestInterface ( const GUUIID _interfaceID,
void **  _outputInterface 
)
pure virtual

Requests an interface that may or may not be supported by this object.

Can be used by the end-user to query for a new interface using the unique ID of the interface they want and implement an interface update.

Parameters
[in]_interfaceIDThe GUUIID of the interface you are requesting.
[out]_outputInterfaceWhere the interface will be stored if function is successful.
Return values
SUCCESSThe interface is supported and function succeded.
INTERFACE_UNSUPPORTEDThe requested interface is not supported.

Implements GW::CORE::GInterface.

◆ Resume()

virtual GReturn GW::AUDIO::GSound::Resume ( )
pure virtual

Attempts to resume a currently paused sound effect.

Currenntly only supports .wav files. GSound fully loads entire audio file into memory. If file is extremely large, consider using GMusic instead. If sound is currently playing, will not attempt to play file without returning an error.

Return values
FAILUREGAudio has not filled it out this object with GAudio's fuunction: "CreateSound".
FAILUREInternal Source voice is NULL - (which could happen if specified .wav file could not be found or encountered an error upon reading in data).
FAILUREIf internal object incounters an error. Unlikely to occur if GAudio's "CreateSound" did not return an error upon filling out this object.
SUCCESSSuccessfully ran without running into any of the above issues.

◆ SetChannelVolumes()

virtual GReturn GW::AUDIO::GSound::SetChannelVolumes ( float *  _values,
int  _numChannels 
)
pure virtual

Attempts to set the output volume for the specified number of outputs to the passed in values.

The amount of values in _values that will be used is based on _numChannels. If you attempt to set the volume of an output your hardware does not support, it will be ignored. If you attempt to set a volume higher that GAudio's master volume, it will be set to the master volume without an error message.

Channels: Supports up to 6 channels AKA 5.1 Audio: INDEX[0] = Left, INDEX[1] = Right, INDEX[2] = Front Center, INDEX[3] = LFE, INDEX[4] = Rear Left, INDEX[5] = Rear Right,

Parameters
[in]_valuesThe output volumes to be set.
[in]_numChannelsThe number of channels affected.
Return values
FAILURE_numChannels is less than 1.
FAILUREGAudio has not filled it out this object with GAudio's fuunction: "CreateSound".
FAILUREInternal Source voice is NULL - (which could happen if specified .wav file could not be found or encountered an error upon reading in data)
FAILURE_values is NULL
FAILURE_values tried to read garbadge data - (_numChannels > amoutn of values in _values)
SUCCESSSuccessfully ran without running into any of the above issues.

◆ SetVolume()

virtual GReturn GW::AUDIO::GSound::SetVolume ( float  _newVolume)
pure virtual

Attempts to change the overall volume.

The amount of values in _values that will be used is based on _numChannels. If you attempt to set a volume higher that GAudio's master volume, it will be set to the master volume without an error message.

Parameters
[in]_newVolumeThe output volume to be set.
Return values
FAILUREGAudio has not filled it out this object with GAudio's fuunction: "CreateSound".
FAILURE_newVolume is less than Zero.
FAILUREIf internal object incounters an error. Unlikely to occur if GAudio's "CreateSound" did not return an error upon filling out this object. *
SUCCESSSuccessfully ran without running into any of the above issues.
SUCCESSSuccessfully ran without running into any of the above issues.

◆ StopSound()

virtual GReturn GW::AUDIO::GSound::StopSound ( )
pure virtual

Attempts to stop playback of sound effect and reset it to begining for future use.

Currenntly only supports .wav files. GSound fully loads entire audio file into memory. If file is extremely large, consider using GMusic instead. Will attempt to comppletely stop playback regaurdless of whether or not sound is playing or paused.

Return values
FAILUREGAudio has not filled it out this object with GAudio's fuunction: "CreateSound".
FAILUREInternal Source voice is NULL - (which could happen if specified .wav file could not be found or encountered an error upon reading in data).
FAILUREIf internal object incounters an error. Unlikely to occur if GAudio's "CreateSound" did not return an error upon filling out this object.
SUCCESSSuccessfully ran without running into any of the above issues.

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