Class that loads and plays a sound from an ogg file, or a native sound file. In the latter case, the file loaded has to have been produced by converting an .ogg file to a small3d native binary file using the format converter program, s3dfc, produced by this project's build scripts, for example by running s3dfc engine.ogg engine.bin (this would convert an engine sound .ogg file to a native binary sound file) ATTENTION: Unfortunately the native binary files have issues across architectures. So for example binaries created on Windows do not work on Linux. They need to be created and tested separately for each.
More...
#include <Sound.hpp>
Class that loads and plays a sound from an ogg file, or a native sound file. In the latter case, the file loaded has to have been produced by converting an .ogg file to a small3d native binary file using the format converter program, s3dfc, produced by this project's build scripts, for example by running s3dfc engine.ogg engine.bin (this would convert an engine sound .ogg file to a native binary sound file) ATTENTION: Unfortunately the native binary files have issues across architectures. So for example binaries created on Windows do not work on Linux. They need to be created and tested separately for each.
◆ Sound()
small3d::Sound::Sound |
( |
const std::string & |
soundFilePath | ) |
|
|
explicit |
Ogg file loading constructor.
- Parameters
-
soundFilePath | The path to the ogg file from which to load the sound. |
◆ divideVolume()
void small3d::Sound::divideVolume |
( |
uint32_t |
divisor | ) |
|
Divide the volume (in order to lower it).
- Parameters
-
divisor | Number to divide the volume by. |
◆ play()
void small3d::Sound::play |
( |
const bool |
repeat = false | ) |
|
Play the sound.
- Parameters
-
repeat | Repeat the sound after it ends? |
◆ saveBinary()
void small3d::Sound::saveBinary |
( |
const std::string & |
binaryFilePath | ) |
|
Save sound data in binary format.
- Parameters
-
binaryFilePath | Path of file to save binary data to. |
The documentation for this class was generated from the following files: