◆ 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
-
| SUCCESS | Successfully decremented the internal reference count. |
| FAILURE | Decrementing 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] | _outCount | The total number of active references of this object. |
- Return values
-
| SUCCESS | Always, 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] | The | unsigned int which will be stored with the value. |
- Return values
-
| FAILURE | GAudio has not filled it out this object with GAudio's fuunction: "CreateSound". |
| SUCCESS | Successfully 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] | The | unsigned int which will be stored with the value. |
- Return values
-
| FAILURE | GAudio has not filled it out this object with GAudio's fuunction: "CreateSound". |
| SUCCESS | Successfully 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
-
| SUCCESS | Successfully incremented the internal reference count. |
| FAILURE | Incrementation 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] | The | bool which will be stored with the value. |
- Return values
-
| FAILURE | GAudio has not filled it out this object with GAudio's fuunction: "CreateSound". |
| SUCCESS | Always, 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
-
| FAILURE | GAudio has not filled it out this object with GAudio's fuunction: "CreateSound". |
| FAILURE | Internal Source voice is NULL - (which could happen if specified .wav file could not be found or encountered an error upon reading in data). |
| FAILURE | If internal object incounters an error. Unlikely to occur if GAudio's "CreateSound" did not return an error upon filling out this object. |
| SUCCESS | Successfully 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
-
| FAILURE | GAudio has not filled it out this object with GAudio's fuunction: "CreateSound". |
| FAILURE | Internal Source voice is NULL - (which could happen if specified .wav file could not be found or encountered an error upon reading in data). |
| FAILURE | If internal object incounters an error. Unlikely to occur if GAudio's "CreateSound" did not return an error upon filling out this object. |
| SUCCESS | Successfully 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] | _interfaceID | The GUUIID of the interface you are requesting. |
| [out] | _outputInterface | Where the interface will be stored if function is successful. |
- Return values
-
| SUCCESS | The interface is supported and function succeded. |
| INTERFACE_UNSUPPORTED | The 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
-
| FAILURE | GAudio has not filled it out this object with GAudio's fuunction: "CreateSound". |
| FAILURE | Internal Source voice is NULL - (which could happen if specified .wav file could not be found or encountered an error upon reading in data). |
| FAILURE | If internal object incounters an error. Unlikely to occur if GAudio's "CreateSound" did not return an error upon filling out this object. |
| SUCCESS | Successfully 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] | _values | The output volumes to be set. |
| [in] | _numChannels | The number of channels affected. |
- Return values
-
| FAILURE | _numChannels is less than 1. |
| FAILURE | GAudio has not filled it out this object with GAudio's fuunction: "CreateSound". |
| FAILURE | Internal 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) |
| SUCCESS | Successfully 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] | _newVolume | The output volume to be set. |
- Return values
-
| FAILURE | GAudio has not filled it out this object with GAudio's fuunction: "CreateSound". |
| FAILURE | _newVolume is less than Zero. |
| FAILURE | If internal object incounters an error. Unlikely to occur if GAudio's "CreateSound" did not return an error upon filling out this object. * |
| SUCCESS | Successfully ran without running into any of the above issues. |
| SUCCESS | Successfully 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
-
| FAILURE | GAudio has not filled it out this object with GAudio's fuunction: "CreateSound". |
| FAILURE | Internal Source voice is NULL - (which could happen if specified .wav file could not be found or encountered an error upon reading in data). |
| FAILURE | If internal object incounters an error. Unlikely to occur if GAudio's "CreateSound" did not return an error upon filling out this object. |
| SUCCESS | Successfully ran without running into any of the above issues. |
The documentation for this class was generated from the following file: