Bottle 2D - Lua API 1.0.0
All you need to create games using bottle2D.
|
A short sound that can be loaded from a file. More...
#include <header.hpp>
Public Member Functions | |
Sound () | |
Constructor to create an empty sound. | |
Sound (string filename) | |
Create a sound and load it from a file. | |
nil | LoadFromFile (string filename) |
Load a sound from a file. | |
number | GetSampleRate () |
Get the sample rate return Sound frequency (number of samples per second) | |
number | GetChannelsCount () |
Return the number of channels (1 = mono, 2 = stereo, ...) return Number of channels. | |
number | GetDuration () |
Get the sound duration return Sound duration, in seconds. |
A short sound that can be loaded from a file.
Note: a sound should not be used to load musics ( > 1 min) since the whole file is loaded into memory.
Sound::Sound | ( | ) |
Constructor to create an empty sound.
Sound::Sound | ( | string | filename | ) |
Create a sound and load it from a file.
number Sound::GetChannelsCount | ( | ) |
Return the number of channels (1 = mono, 2 = stereo, ...) return Number of channels.
number Sound::GetDuration | ( | ) |
Get the sound duration return Sound duration, in seconds.
number Sound::GetSampleRate | ( | ) |
Get the sample rate return Sound frequency (number of samples per second)
nil Sound::LoadFromFile | ( | string | filename | ) |
Load a sound from a file.
Note: the working directory is the mode's root directory.