Module ncine.audio_buffer
The table containing audio buffer related functions
Functions
ncine.audio_buffer.new (filename) | Constructs an audio buffer object from an audio file. |
ncine.audio_buffer.delete (audio_buffer) | Destroys an audio buffer object and releases its memory |
ncine.audio_buffer.buffer_id (audio_buffer) | Returns the OpenAL buffer id |
ncine.audio_buffer.bytes_per_sample (audio_buffer) | Returns the number of bytes per sample |
ncine.audio_buffer.num_channels (audio_buffer) | Returns the number of audio channels |
ncine.audio_buffer.frequency (audio_buffer) | Returns the samples frequency |
ncine.audio_buffer.num_samples (audio_buffer) | Returns number of samples |
ncine.audio_buffer.duration (audio_buffer) | Returns the duration in seconds |
ncine.audio_buffer.buffer_size (audio_buffer) | Returns the size of the buffer in bytes |
Tables
audiobufferObj | The light user data of an audio buffer object |
Functions
- ncine.audio_buffer.new (filename)
-
Constructs an audio buffer object from an audio file.
Don’t forget to call ncine.audio_buffer.delete when you are done with it!
Parameters:
- filename string The path to an audio file
Returns:
-
audiobufferObj
A new audio buffer object
- ncine.audio_buffer.delete (audio_buffer)
-
Destroys an audio buffer object and releases its memory
Parameters:
- audio_buffer audiobufferObj The audio buffer object to be destroyed
- ncine.audio_buffer.buffer_id (audio_buffer)
-
Returns the OpenAL buffer id
Parameters:
- audio_buffer audiobufferObj
Returns:
-
integer
- ncine.audio_buffer.bytes_per_sample (audio_buffer)
-
Returns the number of bytes per sample
Parameters:
- audio_buffer audiobufferObj
Returns:
-
integer
- ncine.audio_buffer.num_channels (audio_buffer)
-
Returns the number of audio channels
Parameters:
- audio_buffer audiobufferObj
Returns:
-
integer
- ncine.audio_buffer.frequency (audio_buffer)
-
Returns the samples frequency
Parameters:
- audio_buffer audiobufferObj
Returns:
-
integer
- ncine.audio_buffer.num_samples (audio_buffer)
-
Returns number of samples
Parameters:
- audio_buffer audiobufferObj
Returns:
-
integer
- ncine.audio_buffer.duration (audio_buffer)
-
Returns the duration in seconds
Parameters:
- audio_buffer audiobufferObj
Returns:
-
number
- ncine.audio_buffer.buffer_size (audio_buffer)
-
Returns the size of the buffer in bytes
Parameters:
- audio_buffer audiobufferObj
Returns:
-
integer