|
void | Clear () |
| Clears the sound data.
|
|
void | Create (double duration) |
| Creates a sound with a specified duration. More...
|
|
double | Duration () const |
| Gets the duration of the sound in seconds, 0.0 if not loaded. More...
|
|
Si32 | DurationSamples () |
| Gets the duration of the sound in samples, 0 if not loaded. More...
|
|
std::shared_ptr< SoundInstance > | GetInstance () |
| Gets the sound instance. More...
|
|
bool | IsPlaying () |
| Checks if the sound is currently playing. More...
|
|
void | Load (const char *file_name) |
| Loads a sound file. More...
|
|
void | Load (const char *file_name, bool do_unpack) |
| Loads a sound file with the option to unpack it. More...
|
|
void | Load (const char *file_name, bool do_unpack, std::vector< Ui8 > *in_data) |
| Loads a sound file with the option to unpack it and provide input data. More...
|
|
void | Load (const std::string &file_name) |
| Loads a sound file. More...
|
|
void | Load (const std::string &file_name, bool do_unpack) |
| Loads a sound file with the option to unpack it. More...
|
|
SoundHandle | Play () |
| Plays the sound. More...
|
|
SoundHandle | Play (float volume) |
| Plays the sound with a specified volume. More...
|
|
Si16 * | RawData () |
| Gets the raw sound data. More...
|
|
void | Stop () |
| Stops the sound.
|
|
Si32 | StreamOut (Si32 offset, Si32 size, Si16 *out_buffer, Si32 out_buffer_samples) |
| Streams out a portion of the sound data. More...
|
|
◆ Create()
void arctic::Sound::Create |
( |
double |
duration | ) |
|
Creates a sound with a specified duration.
- Parameters
-
duration | The duration of the sound in seconds |
◆ Duration()
double arctic::Sound::Duration |
( |
| ) |
const |
Gets the duration of the sound in seconds, 0.0 if not loaded.
- Returns
- The duration of the sound in seconds
◆ DurationSamples()
Si32 arctic::Sound::DurationSamples |
( |
| ) |
|
Gets the duration of the sound in samples, 0 if not loaded.
- Returns
- The duration of the sound in samples
◆ GetInstance()
Gets the sound instance.
- Returns
- A shared pointer to the sound instance
◆ IsPlaying()
bool arctic::Sound::IsPlaying |
( |
| ) |
|
Checks if the sound is currently playing.
- Returns
- True if the sound is playing, false otherwise
◆ Load() [1/5]
void arctic::Sound::Load |
( |
const char * |
file_name | ) |
|
Loads a sound file.
- Parameters
-
file_name | The name of the file to load |
◆ Load() [2/5]
void arctic::Sound::Load |
( |
const char * |
file_name, |
|
|
bool |
do_unpack |
|
) |
| |
Loads a sound file with the option to unpack it.
- Parameters
-
file_name | The name of the file to load |
do_unpack | Whether to unpack the sound data |
◆ Load() [3/5]
void arctic::Sound::Load |
( |
const char * |
file_name, |
|
|
bool |
do_unpack, |
|
|
std::vector< Ui8 > * |
in_data |
|
) |
| |
Loads a sound file with the option to unpack it and provide input data.
- Parameters
-
file_name | The name of the file (used for logging only) |
do_unpack | Whether to unpack the sound data |
in_data | Pointer to input data vector |
◆ Load() [4/5]
void arctic::Sound::Load |
( |
const std::string & |
file_name | ) |
|
Loads a sound file.
- Parameters
-
file_name | The name of the file to load |
◆ Load() [5/5]
void arctic::Sound::Load |
( |
const std::string & |
file_name, |
|
|
bool |
do_unpack |
|
) |
| |
Loads a sound file with the option to unpack it.
- Parameters
-
file_name | The name of the file to load |
do_unpack | Whether to unpack the sound data |
◆ Play() [1/2]
Plays the sound.
- Returns
- A handle to the played sound
◆ Play() [2/2]
Plays the sound with a specified volume.
- Parameters
-
volume | The volume to play the sound at, 1.0f is the default |
- Returns
- A handle to the played sound
◆ RawData()
Si16 * arctic::Sound::RawData |
( |
| ) |
|
Gets the raw sound data.
- Returns
- Pointer to the raw sound data
◆ StreamOut()
Si32 arctic::Sound::StreamOut |
( |
Si32 |
offset, |
|
|
Si32 |
size, |
|
|
Si16 * |
out_buffer, |
|
|
Si32 |
out_buffer_samples |
|
) |
| |
Streams out a portion of the sound data.
- Parameters
-
offset | The starting offset in samples |
size | The number of samples to stream |
out_buffer | The output buffer to write the samples to |
out_buffer_samples | The size of the output buffer in samples |
- Returns
- The number of samples actually written
The documentation for this class was generated from the following files:
- /builds/seaice/arctic/engine/easy_sound.h
- /builds/seaice/arctic/engine/easy_sound.cpp