- Constants
- release_buffers
- get_boolean
- get_booleanv
- get_double
- get_doublev
- get_enum_value
- get_float
- get_floatv
- get_integer
- get_integerv
- get_proc_addr
- get_string
- is_enabled
- is_extension_present
- pause_sources
- play_sources
- release_sources
- rewind_sources
- speed_sound
- stop_sources
- version
- check_error
- create_buffer
- create_buffer_from_id
- create_listener
- create_source
- create_sources
- disable
- distance_model
- doppler_factor
- enable
- generate_buffers
- DistanceParameter
- DopplerParameter
- SourceType
- BuffersQueryParameter
- BufferState
- UnsignedBufferFormat
- AlError
- SignedBufferFormat
- BufferFormat
- SourceParameter
- BufferParameter
- ListenerParameter
- SourceProperty
- SourceState
- DistanceModel
- Al
- Err
- Source
- generate
- release
- get_id
- is_valid
- attach_buffer
- detach_buffer
- get_attached_buffer
- get_buffer_id
- set_relative
- is_relative
- get_type
- get_state
- get_offset_time
- get_offset_sample
- get_offset_byte
- get_buffers_queued
- get_buffers_processed
- get_pitch
- set_pitch
- get_gain
- set_gain
- get_gain_bounds
- set_gain_bounds
- get_max_distance
- set_max_distance
- get_rolloff
- set_rolloff
- get_cone_outer_gain
- set_cone_outer_gain
- get_cone_inner_angle
- set_cone_inner_angle
- get_cone_outer_angle
- set_cone_outer_angle
- get_reference_distance
- set_reference_distance
- get_position
- set_position
- get_velocity
- set_velocity
- get_direction
- set_direction
- sourcef
- source3f
- sourcefv
- sourcei
- source3i
- sourceiv
- play
- pause
- stop
- loop
- is_looping
- rewind
- queue_buffer
- queue_buffers
- unqueue_buffer
- unqueue_buffers
- unqueue_all
- Listener
- Buffer
const (
al_major_version = 1
al_minor_version = 1
)
Runtime AL version
const (
al_none = 0
al_false = 0
al_true = 1
)
fn release_buffers(b []Buffer) !
release_buffers deletes multiple instances of Buffer
fn get_boolean(param int) !bool
get_boolean returns the boolean value of a parameter
fn get_booleanv(param int, mut values [3]bool) !
get_booleanv retrieves the boolean values of a parameter
fn get_double(param int) !f64
get_double returns the double value of a parameter
fn get_doublev(param int, mut values [3]f64) !
get_doublev retrieves the double values of a parameter
fn get_enum_value(ename string) !int
get_enum_value returns an enumeration value
fn get_float(param int) !f32
get_float returns the float value of a parameter
fn get_floatv(param int, mut values [3]f32) !
get_floatv retrieves the float values a parameter
fn get_integer(param int) !int
get_integer returns the integer value of a parameter
fn get_integerv(param int, mut values [3]int) !
get_integerv retrieves the integer values a parameter
fn get_proc_addr(fname string) !voidptr
get_proc_addr returns the process address
fn get_string(param int) !string
get_string returns the string value a parameter
fn is_enabled(capability int) !bool
is_enabled checks if a capability is enabled
fn is_extension_present(ext string) !bool
is_extension_present checks wether an extension is present
fn pause_sources(s []Source) !
pause_sources pauses multiple sources at once
fn play_sources(s []Source) !
play_sources plays multiple sources at once
fn release_sources(s []Source) !
release_sources deletes multiple instances of Source
fn rewind_sources(s []Source) !
rewind_sources rewinds multiple sources at once
fn speed_sound(value f32) !
speed_sound sets the speed of sound
fn stop_sources(s []Source) !
stop_sources stops multiple sources at once
fn version() semver.SemVer
version returns the AL semantic version
fn check_error() !
check_error checks and panics on error
fn create_buffer() Buffer
create_buffer returns an instance of Buffer
fn create_buffer_from_id(id u32) Buffer
create_buffer_from_id creates a Buffer with a specified id
fn create_listener() Listener
create_listener returns an instance of Listener
fn create_source() Source
create_source returns a new instance of Source
fn create_sources(mut sources []Source) !
create_sources generates multiple instances of Source
fn disable(capability int) !
disable an OpenAL capability
fn distance_model(model DistanceModel) !
distance_model sets the distance model
fn doppler_factor(value f32) !
doppler_factor sets the doppler factor
fn enable(capability int) !
enable an OpenAL capability
fn generate_buffers(mut buffers []Buffer) !
generate_buffers creates multiple instances of Buffer
enum DistanceParameter {
model = 0xD000
inverse = 0xD001
inverse_clamped = 0xD002
linear = 0xD003
linear_clamped = 0xD004
exponent = 0xD005
exponent_clamped = 0xD006
}
Distance model values
enum DopplerParameter {
factor = 0xC000
velocity = 0xC001
speed_of_sound = 0xC003
}
Doppler values
enum SourceType {
source_type = 0x1027
source_static = 0x1028
source_streaming = 0x1029
source_undetermined = 0x1030
}
Source type values
enum BuffersQueryParameter {
queued = 0x1015
processed = 0x1016
}
enum BufferState {
unused = 0x2010
pending = 0x2011
processed = 0x2012
}
Buffer states
enum UnsignedBufferFormat {
mono = 0x1100
stereo = 0x1102
}
Unsinged buffer formats
enum AlError {
no_error = 0
invalid_name = 0xA001
invalid_enum = 0xA002
invalid_value = 0xA003
invalid_operation = 0xA004
out_of_memory = 0xA005
}
AL error codes
enum SignedBufferFormat {
mono = 0x1101
stereo = 0x1103
}
Signed buffer formats
enum BufferFormat {
mono8 = 0x1100
mono16 = 0x1101
stereo8 = 0x1102
stereo16 = 0x1103
}
Buffer format specifier
enum SourceParameter {
source_relative = 0x202
cone_inner_angle = 0x1001
cone_outer_angle = 0x1002
pitch = 0x1003
position = 0x1004
direction = 0x1005
velocity = 0x1006
looping = 0x1007
buffer = 0x1009
gain = 0x100A
min_gain = 0x100D
max_gain = 0x100E
orientation = 0x100F
source_state = 0x1010
}
Source parameter values
enum BufferParameter {
frequency = 0x2001
bits = 0x2002
channels = 0x2003
size = 0x2004
}
Buffer parameter values
enum ListenerParameter {
gain = 0x100A
position = 0x1004
velocity = 0x1006
orientation = 0x100F
}
Listener parameter values
enum SourceProperty {
reference_distance = 0x1020
rolloff_factor = 0x1021
cone_outer_gain = 0x1022
max_distance = 0x1023
sec_offset = 0x1024
sample_offset = 0x1025
byte_offset = 0x1026
}
Source property values
enum SourceState {
initial = 0x1011
playing = 0x1012
paused = 0x1013
stopped = 0x1014
undetermined = 0x1015
}
Source state values
enum DistanceModel {
inverse_distance
inverse_distance_clamped
linear_distance
linear_ditance_clamped
exponent_distance
exponent_distance_clamped
}
Distance model formulae
enum Al {
vendor = 0xB001
version = 0xB002
renderer = 0xB003
extensions = 0xB004
}
Context values
struct Err {
mut:
code int
}
Err defines an error code for a particular error
fn (err &Err) str() string
str formats the error into a string
struct Source {
mut:
id u32
}
Source wraps functionality around an OpenAL source
fn (mut s Source) generate() !
generate source
fn (s Source) release() !
release source
fn (s Source) get_id() u32
get_id returns the id of the source
fn (s Source) is_valid() bool
is_valid returns true if source is valid
fn (s Source) attach_buffer(b &Buffer) !
attach_buffer attaches the buffer to the source
fn (s Source) detach_buffer() !
detach_buffer detaches a buffer from the source
fn (s Source) get_attached_buffer() !int
get_attached_buffer returns the attached buffer
fn (s Source) get_buffer_id() !int
get_buffer_id returns the buffer id linked to the source
fn (s Source) set_relative(rel bool) !
set_relative sets the source as relative to the listener
fn (s Source) is_relative() !bool
is_relative returns true if source position is relative to listener
fn (s Source) get_type() !SourceType
get_type returns a source type
fn (s Source) get_state() !SourceState
get_state returns a source state
fn (s Source) get_offset_time() !f32
get_offset_time returns the playback position offset in seconds
fn (s Source) get_offset_sample() !f32
get_offset_sample returns the playback position offset in samples
fn (s Source) get_offset_byte() !f32
get_offset_byte returns the playback position offset in byte
fn (s Source) get_buffers_queued() !int
get_buffers_queued returns the number of buffers queued in the source
fn (s Source) get_buffers_processed() !int
get_buffers_processed returns the number of buffers in the queue that have been processed
fn (s Source) get_pitch() !f32
get_pitch retuns the pitch of the source
fn (s Source) set_pitch(value f32) !
set_pitch sets the pitch of the source
fn (s Source) get_gain() !f32
get_gain returns the gain of the source
fn (s Source) set_gain(value f32) !
set_gain sets the gain of the source
fn (s Source) get_gain_bounds() !(f32, f32)
get_gain_bounds returns the min/max gain of the source
fn (s Source) set_gain_bounds(min f32, max f32) !
set_gain_bounds sets the min/max gain of the source
fn (s Source) get_max_distance() !f32
get_max_distance returns max distance of the source
fn (s Source) set_max_distance(value f32) !
set_max_distance sets the max distance of the source
fn (s Source) get_rolloff() !f32
get_rolloff returns the rolloff factor of the source
fn (s Source) set_rolloff(value f32) !
set_rolloff sets the rolloff factor of the source
fn (s Source) get_cone_outer_gain() !f32
get_cone_outer_gain returns the cone outer gain of the source
fn (s Source) set_cone_outer_gain(value f32) !
set_cone_outer_gain sets the cone outer gain of the source
fn (s Source) get_cone_inner_angle() !f32
get_cone_inner_angle returns the cone inner angle of the source
fn (s Source) set_cone_inner_angle(value f32) !
set_cone_inner_angle sets the cone inner angle of the source
fn (s Source) get_cone_outer_angle() !f32
get_cone_outer_angle returns the cone outer angle of the source
fn (s Source) set_cone_outer_angle(value f32) !
set_cone_outer_angle sets the cone outer angle of the source
fn (s Source) get_reference_distance() !f32
get_reference_distance Get source reference distance
fn (s Source) set_reference_distance(value f32) !
set_reference_distance sets the reference distance of the source
fn (s Source) get_position() !(f32, f32, f32)
get_position returns the position of the source
fn (s Source) set_position(v1 f32, v2 f32, v3 f32) !
set_position sets the position of the source
fn (s Source) get_velocity() !(f32, f32, f32)
get_velocity returns the velocity of the source
fn (s Source) set_velocity(v1 f32, v2 f32, v3 f32) !
set_velocity sets the velocity of the source
fn (s Source) get_direction() !(f32, f32, f32)
get_direction returns the direction of the source
fn (s Source) set_direction(v1 f32, v2 f32, v3 f32) !
set_direction sets the direction of the source
fn (s Source) sourcef(param int, value f32) !
sourcef sets a source parameter value as float
fn (s Source) source3f(param int, v1 f32, v2 f32, v3 f32) !
source3f sets a source parameter value as vector of floats
fn (s Source) sourcefv(param int, values []f32) !
sourcefv sets a source parameter value as vector of floats
fn (s Source) sourcei(param int, value int) !
sourcei sets a source parameter value as integer
fn (s Source) source3i(param int, v1 int, v2 int, v3 int) !
source3i sets a source parameter value as vector of integers
fn (s Source) sourceiv(param int, values []int) !
sourceiv sets a source parameter value as vector of integers
fn (s Source) play() !
play the source
fn (s Source) pause() !
pause the source
fn (s Source) stop() !
stop the source
fn (s Source) loop(loop bool) !
loop sets source to a looping state
fn (s Source) is_looping() !bool
is_looping returns true if source is set to loop
fn (s Source) rewind() !
rewind the source
fn (s Source) queue_buffer(b Buffer) !
queue_buffer adds a buffer into the source's queue
fn (s Source) queue_buffers(b []Buffer) !
queue_buffers adds buffers into the source's queue
fn (s Source) unqueue_buffer() !Buffer
unqueue_buffer removes a buffer fron the source's queue
fn (s Source) unqueue_buffers(size int) ![]Buffer
unqueue_buffers removes buffers from the source's queue
fn (s Source) unqueue_all() !
struct Listener {
}
Listener wraps functionality around an OpenAL listener
fn (l Listener) get_gain() !f32
get_gain returns the gain of the listener
fn (l Listener) set_gain(value f32) !
set_gain sets the gain of the listener
fn (l Listener) get_position() !(f32, f32, f32)
get_position returns the position of the listener
fn (l Listener) set_position(x f32, y f32, z f32) !
set_position sets the position of the listener
fn (l Listener) get_velocity() !(f32, f32, f32)
get_velocity returns the velocity of the listener
fn (l Listener) set_velocity(x f32, y f32, z f32) !
set_velocity sets the velocity of the listener
fn (l Listener) get_orientation() ![]f32
get_orientation returns the orientation of the listener
fn (l Listener) set_orientation(value []f32) !
set_orientation sets the orientation of the listener
fn (l Listener) listenerf(param int, value f32) !
listenerf sets a listener parameter value as float
fn (l Listener) listener3f(param int, v1 f32, v2 f32, v3 f32) !
listener3f sets a listener parameter value as vector of floats
fn (l Listener) listenerfv(param int, values []f32) !
listenefv sets a listener parameter value as vector of floats
fn (l Listener) listeneri(param int, value int) !
listeneri sets a listener parameter value as integer
fn (l Listener) listener3i(param int, v1 int, v2 int, v3 int) !
listener3i sets a listener parameter value as vector of integers
fn (l Listener) listeneriv(param int, values []int) !
listeneriv sets a listener parameter value as vector of integers
fn (l Listener) get_listenerf(param int) !f32
get_listenerf returns a listener parameter value as float
fn (l Listener) get_listener3f(param int) !(f32, f32, f32)
get_listener3f returns a listener parameter value as vector of floats
fn (l Listener) get_listenerfv(param int, size int) ![]f32
get_listenerfv returns a listener parameter value as vector of floats
fn (l Listener) get_listeneri(param int) !int
get_listeneri returns a listener parameter value as integer
fn (l Listener) get_listener3i(param int) !(int, int, int)
get_listener3i returns a listener parameter value as vector of integers
fn (l Listener) get_listeneriv(param int, size int) ![]int
get_listeneriv returns a listener parameter value as vector of integers
struct Buffer {
mut:
id u32
}
Buffer wraps the functionality of an OpenAL buffer
fn (mut b Buffer) generate() !
generate a buffer
fn (b Buffer) release() !
release buffer
fn (b Buffer) is_valid() bool
is_valid validates Buffer
fn (b Buffer) get_id() u32
get_id returns the id of the buffer
fn (b Buffer) get_frequency() !int
get_frequency returns the frequency of the buffer
fn (b Buffer) get_bits() !int
get_bits returns the bits of the buffer
fn (b Buffer) get_channels() !int
get_channels returns the number channels of the buffer
fn (b Buffer) get_size() !int
get_size returns the size of the buffer
fn (b Buffer) set_unsigned_data(format UnsignedBufferFormat, data []u8, frequency int) !
set_unsigned_data sets the buffer with unsigned raw data
fn (b Buffer) set_signed_data(format SignedBufferFormat, data []i16, frequency int) !
set_signed_data sets the buffer with signed raw data
fn (b Buffer) bufferf(param int, value f32) !
bufferf sets a buffer parameter value as float
fn (b Buffer) buffer3f(param int, value1 f32, value2 f32, value3 f32) !
buffer3f sets a buffer parameter value as a tuple of floats
fn (b Buffer) bufferfv(param int, values []f32) !
bufferfv sets a buffer parameter value as a vector of floats
fn (b Buffer) bufferi(param int, value int) !
bufferi sets a buffer parameter value as integer
fn (b Buffer) buffer3i(param int, v1 int, v2 int, v3 int) !
buffer3i sets a buffer parameter value as a tuple of integers
fn (b Buffer) bufferiv(param int, values []int) !
bufferiv sets a buffer parameter value as vector of integers
fn (b Buffer) get_bufferf(param int) !f32
get_bufferf returns a buffer parameter value as float
fn (b Buffer) get_buffer3f(param int) !(f32, f32, f32)
get_buffer3f returns a buffer parameter value as a tuple of floats
fn (b Buffer) get_bufferfv(param int, size int) ![]f32
get_bufferfv returns a buffer parameter value as vector of floats
fn (b Buffer) get_bufferi(param int) !int
get_bufferi returns a buffer parameter value as integer
fn (b Buffer) get_buffer3i(param int) !(int, int, int)
get_buffer3i returns a buffer parameter value as a tuple of integers
fn (b Buffer) get_bufferiv(param int, size int) ![]int
get_bufferiv returns a buffer parameter value as vector of integers