Bottle 2D - Lua API 1.0.0
All you need to create games using bottle2D.
Public Member Functions

Sound Class Reference

A short sound that can be loaded from a file. More...

#include <header.hpp>

List of all members.

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.

Detailed Description

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.


Constructor & Destructor Documentation

Sound::Sound ( )

Constructor to create an empty sound.

Sound::Sound ( string  filename)

Create a sound and load it from a file.


Member Function Documentation

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.


The documentation for this class was generated from the following file:
 All Classes Files Functions Variables