al

package
v0.0.0-...-793ea6c Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 24, 2021 License: BSD-3-Clause Imports: 10 Imported by: 4

Documentation

Overview

Package al implements Go bindings to OpenAL.

To avoid the requirement of users having to download OpenAL (or for developers to have to distribute dynamic libraries with their applications), this package works as a sort-of automatic 'installer'

The dynamic OpenAL-Soft library is packed as a binary blob within this package automatically for you.

When an application imports this package the installer will automatically run. It is not visible to users and only writes a single file to the hard drive *if it does not exist*.

Because OpenAL-Soft is LGPL licensed it is required by the license that users be able to run the application with their own version of the library, we are not lawyers and you should consult a lawyer to know in full if you are obeying the LGPL license of OpenAL-Soft when using this library, but:

You should simply inform your users where they can place their own OpenAL-Soft dynamic link library for their specific platform, file named as shown below, into their home directory under the ".azul3d" directory created on their operating system's file system:

linux/amd64: libopenal_soft.so.1.15.1

And it will be dynamically linked and loaded instead of ours. Should the user wish to restore our dynamic link library, they can simply delete theirs and it will be automatically placed there once again.

Index

Constants

View Source
const (
	// Context attribute: <int32> Hz.
	ALC_FREQUENCY int32 = C.ALC_FREQUENCY

	// Context attribute: <int32> Hz.
	ALC_REFRESH int32 = C.ALC_REFRESH

	// Context attribute: TRUE or FALSE.
	ALC_SYNC int32 = C.ALC_SYNC

	// Context attribute: <int32> requested Mono (3D) Sources.
	ALC_MONO_SOURCES int32 = C.ALC_MONO_SOURCES

	// Context attribute: <int32> requested Stereo Sources.
	ALC_STEREO_SOURCES int32 = C.ALC_STEREO_SOURCES

	// Runtime ALC version.
	ALC_MAJOR_VERSION int32 = C.ALC_MAJOR_VERSION
	ALC_MINOR_VERSION int32 = C.ALC_MINOR_VERSION

	// Context attribute list properties.
	ALC_ATTRIBUTES_SIZE int32 = C.ALC_ATTRIBUTES_SIZE
	ALC_ALL_ATTRIBUTES  int32 = C.ALC_ALL_ATTRIBUTES

	// String for the default device specifier.
	ALC_DEFAULT_DEVICE_SPECIFIER int32 = C.ALC_DEFAULT_DEVICE_SPECIFIER

	// String for the given device's specifier.
	//
	// If device handle is NULL, it is instead a null-char separated list of
	// strings of known device specifiers (list ends with an empty string).
	ALC_DEVICE_SPECIFIER int32 = C.ALC_DEVICE_SPECIFIER

	// String for space-separated list of ALC extensions.
	ALC_EXTENSIONS int32 = C.ALC_EXTENSIONS

	// Capture extension
	ALC_EXT_CAPTURE int32 = C.ALC_EXT_CAPTURE

	// String for the given capture device's specifier.
	//
	// If device handle is NULL, it is instead a null-char separated list of
	// strings of known capture device specifiers (list ends with an empty string).
	ALC_CAPTURE_DEVICE_SPECIFIER int32 = C.ALC_CAPTURE_DEVICE_SPECIFIER

	// String for the default capture device specifier.
	ALC_CAPTURE_DEFAULT_DEVICE_SPECIFIER int32 = C.ALC_CAPTURE_DEFAULT_DEVICE_SPECIFIER

	// Number of sample frames available for capture.
	ALC_CAPTURE_SAMPLES int32 = C.ALC_CAPTURE_SAMPLES

	// Enumerate All extension
	ALC_ENUMERATE_ALL_EXT int32 = C.ALC_ENUMERATE_ALL_EXT

	// String for the default extended device specifier.
	ALC_DEFAULT_ALL_DEVICES_SPECIFIER int32 = C.ALC_DEFAULT_ALL_DEVICES_SPECIFIER

	// String for the given extended device's specifier.
	//
	// If device handle is NULL, it is instead a null-char separated list of
	// strings of known extended device specifiers (list ends with an empty string).
	ALC_ALL_DEVICES_SPECIFIER int32 = C.ALC_ALL_DEVICES_SPECIFIER
)
View Source
const (
	// "no distance model" or "no buffer"
	NONE int32 = C.AL_NONE

	// Boolean False.
	FALSE int32 = C.AL_FALSE

	// Boolean True.
	TRUE int32 = C.AL_TRUE

	// Relative source.
	// Type:	uint8
	// Range:   [TRUE, FALSE]
	// Default: FALSE
	//
	// Specifies if the Source has relative coordinates.
	SOURCE_RELATIVE int32 = C.AL_SOURCE_RELATIVE

	// Inner cone angle, in degrees.
	// Type:	int32, float32
	// Range:   [0 - 360]
	// Default: 360
	//
	// The angle covered by the inner cone, where the source will not attenuate.
	CONE_INNER_ANGLE int32 = C.AL_CONE_INNER_ANGLE

	// Outer cone angle, in degrees.
	// Range:   [0 - 360]
	// Default: 360
	//
	// The angle covered by the outer cone, where the source will be fully
	// attenuated.
	CONE_OUTER_ANGLE int32 = C.AL_CONE_OUTER_ANGLE

	// Source pitch.
	// Type:	float32
	// Range:   [0.5 - 2.0]
	// Default: 1.0
	//
	// A multiplier for the frequency (sample rate) of the source's buffer.
	PITCH int32 = C.AL_PITCH

	// Source or listener position.
	// Type:	float32[3], int32[3]
	// Default: {0, 0, 0}
	//
	// The source or listener location in three dimensional space.
	//
	// OpenAL, like OpenGL, uses a right handed coordinate system, where in a
	// frontal default view X (thumb) points right, Y points up (index finger), and
	// Z points towards the viewer/camera (middle finger).
	//
	// To switch from a left handed coordinate system, flip the sign on the Z
	// coordinate.
	POSITION int32 = C.AL_POSITION

	// Source direction.
	// Type:	float32[3], int32[3]
	// Default: {0, 0, 0}
	//
	// Specifies the current direction in local space.
	// A zero-length vector specifies an omni-directional source (cone is ignored).
	DIRECTION int32 = C.AL_DIRECTION

	// Source or listener velocity.
	// Type:	float32[3], int32[3]
	// Default: {0, 0, 0}
	//
	// Specifies the current velocity in local space.
	VELOCITY int32 = C.AL_VELOCITY

	// Source looping.
	// Type:	uint8
	// Range:   [TRUE, FALSE]
	// Default: FALSE
	//
	// Specifies whether source is looping.
	LOOPING int32 = C.AL_LOOPING

	// Source buffer.
	// Type:  uint32
	// Range: any valid Buffer.
	//
	// Specifies the buffer to provide sound samples.
	BUFFER int32 = C.AL_BUFFER

	// Source or listener gain.
	// Type:  float32
	// Range: [0.0 - ]
	//
	// A value of 1.0 means unattenuated. Each division by 2 equals an attenuation
	// of about -6dB. Each multiplicaton by 2 equals an amplification of about
	// +6dB.
	//
	// A value of 0.0 is meaningless with respect to a logarithmic scale; it is
	// silent.
	GAIN int32 = C.AL_GAIN

	// Minimum source gain.
	// Type:  float32
	// Range: [0.0 - 1.0]
	//
	// The minimum gain allowed for a source, after distance and cone attenation is
	// applied (if applicable).
	MIN_GAIN int32 = C.AL_MIN_GAIN

	// Maximum source gain.
	// Type:  float32
	// Range: [0.0 - 1.0]
	//
	// The maximum gain allowed for a source, after distance and cone attenation is
	// applied (if applicable).
	MAX_GAIN int32 = C.AL_MAX_GAIN

	// Listener orientation.
	// Type: float32[6]
	// Default: {0.0, 0.0, -1.0, 0.0, 1.0, 0.0}
	//
	// Effectively two three dimensional vectors. The first vector is the front (or
	// "at") and the second is the top (or "up").
	//
	// Both vectors are in local space.
	ORIENTATION int32 = C.AL_ORIENTATION

	// Source state (query only).
	// Type:  int32
	// Range: [INITIAL, PLAYING, PAUSED, STOPPED]
	SOURCE_STATE int32 = C.AL_SOURCE_STATE

	// Source state value.
	INITIAL int32 = C.AL_INITIAL
	PLAYING int32 = C.AL_PLAYING
	PAUSED  int32 = C.AL_PAUSED
	STOPPED int32 = C.AL_STOPPED

	// Source Buffer Queue size (query only).
	// Type: int32
	//
	// The number of buffers queued using alSourceQueueBuffers, minus the buffers
	// removed with alSourceUnqueueBuffers.
	BUFFERS_QUEUED int32 = C.AL_BUFFERS_QUEUED

	// Source Buffer Queue processed count (query only).
	// Type: int32
	//
	// The number of queued buffers that have been fully processed, and can be
	// removed with alSourceUnqueueBuffers.
	//
	// Looping sources will never fully process buffers because they will be set to
	// play again for when the source loops.
	BUFFERS_PROCESSED int32 = C.AL_BUFFERS_PROCESSED

	// Source reference distance.
	// Type:	float32
	// Range:   [0.0 - ]
	// Default: 1.0
	//
	// The distance in units that no attenuation occurs.
	//
	// At 0.0, no distance attenuation ever occurs on non-linear attenuation models.
	REFERENCE_DISTANCE int32 = C.AL_REFERENCE_DISTANCE

	// Source rolloff factor.
	// Type:	float32
	// Range:   [0.0 - ]
	// Default: 1.0
	//
	// Multiplier to exaggerate or diminish distance attenuation.
	//
	// At 0.0, no distance attenuation ever occurs.
	ROLLOFF_FACTOR int32 = C.AL_ROLLOFF_FACTOR

	// Outer cone gain.
	// Type:	float32
	// Range:   [0.0 - 1.0]
	// Default: 0.0
	//
	// The gain attenuation applied when the listener is outside of the source's
	// outer cone.
	CONE_OUTER_GAIN int32 = C.AL_CONE_OUTER_GAIN

	// Source maximum distance.
	// Type:	float32
	// Range:   [0.0 - ]
	// Default: +inf
	//
	// The distance above which the source is not attenuated any further with a
	// clamped distance model, or where attenuation reaches 0.0 gain for linear
	// distance models with a default rolloff factor.
	MAX_DISTANCE int32 = C.AL_MAX_DISTANCE

	// Source buffer position, in seconds
	SEC_OFFSET int32 = C.AL_SEC_OFFSET

	// Source buffer position, in sample frames
	SAMPLE_OFFSET int32 = C.AL_SAMPLE_OFFSET

	// Source buffer position, in bytes
	BYTE_OFFSET int32 = C.AL_BYTE_OFFSET

	// Source type (query only).
	// Type:  int32
	// Range: [STATIC, STREAMING, UNDETERMINED]
	//
	// A Source is Static if a Buffer has been attached using BUFFER.
	//
	// A Source is Streaming if one or more Buffers have been attached using
	// alSourceQueueBuffers.
	//
	// A Source is Undetermined when it has the NULL buffer attached using
	// BUFFER.
	SOURCE_TYPE int32 = C.AL_SOURCE_TYPE

	// Source type value.
	STATIC       int32 = C.AL_STATIC
	STREAMING    int32 = C.AL_STREAMING
	UNDETERMINED int32 = C.AL_UNDETERMINED

	// Buffer format specifier.
	FORMAT_MONO8    int32 = C.AL_FORMAT_MONO8
	FORMAT_MONO16   int32 = C.AL_FORMAT_MONO16
	FORMAT_STEREO8  int32 = C.AL_FORMAT_STEREO8
	FORMAT_STEREO16 int32 = C.AL_FORMAT_STEREO16

	// Buffer frequency (query only).
	FREQUENCY int32 = C.AL_FREQUENCY

	// Buffer bits per sample (query only).
	BITS int32 = C.AL_BITS

	// Buffer channel count (query only).
	CHANNELS int32 = C.AL_CHANNELS

	// Buffer data size (query only).
	SIZE int32 = C.AL_SIZE

	// Context string: Vendor ID.
	VENDOR int32 = C.AL_VENDOR

	// Context string: Version.
	VERSION int32 = C.AL_VERSION

	// Context string: Renderer ID.
	RENDERER int32 = C.AL_RENDERER

	// Context string: Space-separated extension list.
	EXTENSIONS int32 = C.AL_EXTENSIONS

	// Doppler scale.
	// Type:	float32
	// Range:   [0.0 - ]
	// Default: 1.0
	//
	// Scale for source and listener velocities.
	DOPPLER_FACTOR int32 = C.AL_DOPPLER_FACTOR

	// Doppler velocity (deprecated).
	//
	// A multiplier applied to the Speed of Sound.
	DOPPLER_VELOCITY int32 = C.AL_DOPPLER_VELOCITY

	// Speed of Sound, in units per second.
	// Type:	float32
	// Range:   [0.0001 - ]
	// Default: 343.3
	//
	// The speed at which sound waves are assumed to travel, when calculating the
	// doppler effect.
	SPEED_OF_SOUND int32 = C.AL_SPEED_OF_SOUND

	// Distance attenuation model.
	// Type:	int32
	// Range:   [NONE, INVERSE_DISTANCE, INVERSE_DISTANCE_CLAMPED,
	//		   LINEAR_DISTANCE, LINEAR_DISTANCE_CLAMPED,
	//		   EXPONENT_DISTANCE, EXPONENT_DISTANCE_CLAMPED]
	// Default: INVERSE_DISTANCE_CLAMPED
	//
	// The model by which sources attenuate with distance.
	//
	// None	 - No distance attenuation.
	// Inverse  - Doubling the distance halves the source gain.
	// Linear   - Linear gain scaling between the reference and max distances.
	// Exponent - Exponential gain dropoff.
	//
	// Clamped variations work like the non-clamped counterparts, except the
	// distance calculated is clamped between the reference and max distances.
	DISTANCE_MODEL int32 = C.AL_DISTANCE_MODEL

	// Distance model value.
	INVERSE_DISTANCE          int32 = C.AL_INVERSE_DISTANCE
	INVERSE_DISTANCE_CLAMPED  int32 = C.AL_INVERSE_DISTANCE_CLAMPED
	LINEAR_DISTANCE           int32 = C.AL_LINEAR_DISTANCE
	LINEAR_DISTANCE_CLAMPED   int32 = C.AL_LINEAR_DISTANCE_CLAMPED
	EXPONENT_DISTANCE         int32 = C.AL_EXPONENT_DISTANCE
	EXPONENT_DISTANCE_CLAMPED int32 = C.AL_EXPONENT_DISTANCE_CLAMPED
)
View Source
const (
	LOKI_IMA_ADPCM_format         int32 = C.AL_LOKI_IMA_ADPCM_format
	FORMAT_IMA_ADPCM_MONO16_EXT   int32 = C.AL_FORMAT_IMA_ADPCM_MONO16_EXT
	FORMAT_IMA_ADPCM_STEREO16_EXT int32 = C.AL_FORMAT_IMA_ADPCM_STEREO16_EXT

	LOKI_WAVE_format int32 = C.AL_LOKI_WAVE_format
	FORMAT_WAVE_EXT  int32 = C.AL_FORMAT_WAVE_EXT

	EXT_vorbis        int32 = C.AL_EXT_vorbis
	FORMAT_VORBIS_EXT int32 = C.AL_FORMAT_VORBIS_EXT

	LOKI_quadriphonic  int32 = C.AL_LOKI_quadriphonic
	FORMAT_QUAD8_LOKI  int32 = C.AL_FORMAT_QUAD8_LOKI
	FORMAT_QUAD16_LOKI int32 = C.AL_FORMAT_QUAD16_LOKI

	EXT_float32           int32 = C.AL_EXT_float32
	FORMAT_MONO_FLOAT32   int32 = C.AL_FORMAT_MONO_FLOAT32
	FORMAT_STEREO_FLOAT32 int32 = C.AL_FORMAT_STEREO_FLOAT32

	EXT_double               int32 = C.AL_EXT_double
	FORMAT_MONO_DOUBLE_EXT   int32 = C.AL_FORMAT_MONO_DOUBLE_EXT
	FORMAT_STEREO_DOUBLE_EXT int32 = C.AL_FORMAT_STEREO_DOUBLE_EXT

	EXT_MULAW               int32 = C.AL_EXT_MULAW
	FORMAT_MONO_MULAW_EXT   int32 = C.AL_FORMAT_MONO_MULAW_EXT
	FORMAT_STEREO_MULAW_EXT int32 = C.AL_FORMAT_STEREO_MULAW_EXT

	EXT_ALAW               int32 = C.AL_EXT_ALAW
	FORMAT_MONO_ALAW_EXT   int32 = C.AL_FORMAT_MONO_ALAW_EXT
	FORMAT_STEREO_ALAW_EXT int32 = C.AL_FORMAT_STEREO_ALAW_EXT

	ALC_LOKI_audio_channel int32 = C.ALC_LOKI_audio_channel
	ALC_CHAN_MAIN_LOKI     int32 = C.ALC_CHAN_MAIN_LOKI
	ALC_CHAN_PCM_LOKI      int32 = C.ALC_CHAN_PCM_LOKI
	ALC_CHAN_CD_LOKI       int32 = C.ALC_CHAN_CD_LOKI

	EXT_MCFORMATS  int32 = C.AL_EXT_MCFORMATS
	FORMAT_QUAD8   int32 = C.AL_FORMAT_QUAD8
	FORMAT_QUAD16  int32 = C.AL_FORMAT_QUAD16
	FORMAT_QUAD32  int32 = C.AL_FORMAT_QUAD32
	FORMAT_REAR8   int32 = C.AL_FORMAT_REAR8
	FORMAT_REAR16  int32 = C.AL_FORMAT_REAR16
	FORMAT_REAR32  int32 = C.AL_FORMAT_REAR32
	FORMAT_51CHN8  int32 = C.AL_FORMAT_51CHN8
	FORMAT_51CHN16 int32 = C.AL_FORMAT_51CHN16
	FORMAT_51CHN32 int32 = C.AL_FORMAT_51CHN32
	FORMAT_61CHN8  int32 = C.AL_FORMAT_61CHN8
	FORMAT_61CHN16 int32 = C.AL_FORMAT_61CHN16
	FORMAT_61CHN32 int32 = C.AL_FORMAT_61CHN32
	FORMAT_71CHN8  int32 = C.AL_FORMAT_71CHN8
	FORMAT_71CHN16 int32 = C.AL_FORMAT_71CHN16
	FORMAT_71CHN32 int32 = C.AL_FORMAT_71CHN32

	EXT_MULAW_MCFORMATS int32 = C.AL_EXT_MULAW_MCFORMATS
	FORMAT_MONO_MULAW   int32 = C.AL_FORMAT_MONO_MULAW
	FORMAT_STEREO_MULAW int32 = C.AL_FORMAT_STEREO_MULAW
	FORMAT_QUAD_MULAW   int32 = C.AL_FORMAT_QUAD_MULAW
	FORMAT_REAR_MULAW   int32 = C.AL_FORMAT_REAR_MULAW
	FORMAT_51CHN_MULAW  int32 = C.AL_FORMAT_51CHN_MULAW
	FORMAT_61CHN_MULAW  int32 = C.AL_FORMAT_61CHN_MULAW
	FORMAT_71CHN_MULAW  int32 = C.AL_FORMAT_71CHN_MULAW

	EXT_IMA4           int32 = C.AL_EXT_IMA4
	FORMAT_MONO_IMA4   int32 = C.AL_FORMAT_MONO_IMA4
	FORMAT_STEREO_IMA4 int32 = C.AL_FORMAT_STEREO_IMA4

	EXT_STATIC_BUFFER int32 = C.AL_EXT_STATIC_BUFFER

	ALC_EXT_EFX int32 = C.ALC_EXT_EFX

	ALC_EXT_disconnect int32 = C.ALC_EXT_disconnect
	ALC_CONNECTED      int32 = C.ALC_CONNECTED

	ALC_EXT_thread_local_context int32 = C.ALC_EXT_thread_local_context

	EXT_source_distance_model int32 = C.AL_EXT_source_distance_model
	SOURCE_DISTANCE_MODEL     int32 = C.AL_SOURCE_DISTANCE_MODEL

	SOFT_buffer_sub_data   int32 = C.AL_SOFT_buffer_sub_data
	BYTE_RW_OFFSETS_SOFT   int32 = C.AL_BYTE_RW_OFFSETS_SOFT
	SAMPLE_RW_OFFSETS_SOFT int32 = C.AL_SAMPLE_RW_OFFSETS_SOFT

	SOFT_loop_points int32 = C.AL_SOFT_loop_points
	LOOP_POINTS_SOFT int32 = C.AL_LOOP_POINTS_SOFT

	EXT_FOLDBACK         int32 = C.AL_EXT_FOLDBACK
	EXT_FOLDBACK_NAME          = C.AL_EXT_FOLDBACK_NAME
	FOLDBACK_EVENT_BLOCK int32 = C.AL_FOLDBACK_EVENT_BLOCK
	FOLDBACK_EVENT_START int32 = C.AL_FOLDBACK_EVENT_START
	FOLDBACK_EVENT_STOP  int32 = C.AL_FOLDBACK_EVENT_STOP
	FOLDBACK_MODE_MONO   int32 = C.AL_FOLDBACK_MODE_MONO
	FOLDBACK_MODE_STEREO int32 = C.AL_FOLDBACK_MODE_STEREO

	ALC_EXT_DEDICATED                     int32 = C.ALC_EXT_DEDICATED
	DEDICATED_GAIN                        int32 = C.AL_DEDICATED_GAIN
	EFFECT_DEDICATED_DIALOGUE             int32 = C.AL_EFFECT_DEDICATED_DIALOGUE
	EFFECT_DEDICATED_LOW_FREQUENCY_EFFECT int32 = C.AL_EFFECT_DEDICATED_LOW_FREQUENCY_EFFECT

	SOFT_buffer_samples int32 = C.AL_SOFT_buffer_samples

	// Channel configurations
	MONO_SOFT       int32 = C.AL_MONO_SOFT
	STEREO_SOFT     int32 = C.AL_STEREO_SOFT
	REAR_SOFT       int32 = C.AL_REAR_SOFT
	QUAD_SOFT       int32 = C.AL_QUAD_SOFT
	AL_5POINT1_SOFT int32 = C.AL_5POINT1_SOFT
	AL_6POINT1_SOFT int32 = C.AL_6POINT1_SOFT
	AL_7POINT1_SOFT int32 = C.AL_7POINT1_SOFT

	// Sample types
	BYTE_SOFT           int32 = C.AL_BYTE_SOFT
	UNSIGNED_BYTE_SOFT  int32 = C.AL_UNSIGNED_BYTE_SOFT
	SHORT_SOFT          int32 = C.AL_SHORT_SOFT
	UNSIGNED_SHORT_SOFT int32 = C.AL_UNSIGNED_SHORT_SOFT
	INT_SOFT            int32 = C.AL_INT_SOFT
	UNSIGNED_INT_SOFT   int32 = C.AL_UNSIGNED_INT_SOFT
	FLOAT_SOFT          int32 = C.AL_FLOAT_SOFT
	DOUBLE_SOFT         int32 = C.AL_DOUBLE_SOFT
	BYTE3_SOFT          int32 = C.AL_BYTE3_SOFT
	UNSIGNED_BYTE3_SOFT int32 = C.AL_UNSIGNED_BYTE3_SOFT

	// Storage formats
	MONO8_SOFT          int32 = C.AL_MONO8_SOFT
	MONO16_SOFT         int32 = C.AL_MONO16_SOFT
	MONO32F_SOFT        int32 = C.AL_MONO32F_SOFT
	STEREO8_SOFT        int32 = C.AL_STEREO8_SOFT
	STEREO16_SOFT       int32 = C.AL_STEREO16_SOFT
	STEREO32F_SOFT      int32 = C.AL_STEREO32F_SOFT
	QUAD8_SOFT          int32 = C.AL_QUAD8_SOFT
	QUAD16_SOFT         int32 = C.AL_QUAD16_SOFT
	QUAD32F_SOFT        int32 = C.AL_QUAD32F_SOFT
	REAR8_SOFT          int32 = C.AL_REAR8_SOFT
	REAR16_SOFT         int32 = C.AL_REAR16_SOFT
	REAR32F_SOFT        int32 = C.AL_REAR32F_SOFT
	AL_5POINT1_8_SOFT   int32 = C.AL_5POINT1_8_SOFT
	AL_5POINT1_16_SOFT  int32 = C.AL_5POINT1_16_SOFT
	AL_5POINT1_32F_SOFT int32 = C.AL_5POINT1_32F_SOFT
	AL_6POINT1_8_SOFT   int32 = C.AL_6POINT1_8_SOFT
	AL_6POINT1_16_SOFT  int32 = C.AL_6POINT1_16_SOFT
	AL_6POINT1_32F_SOFT int32 = C.AL_6POINT1_32F_SOFT
	AL_7POINT1_8_SOFT   int32 = C.AL_7POINT1_8_SOFT
	AL_7POINT1_16_SOFT  int32 = C.AL_7POINT1_16_SOFT
	AL_7POINT1_32F_SOFT int32 = C.AL_7POINT1_32F_SOFT

	// Buffer attributes
	INTERNAL_FORMAT_SOFT int32 = C.AL_INTERNAL_FORMAT_SOFT
	BYTE_LENGTH_SOFT     int32 = C.AL_BYTE_LENGTH_SOFT
	SAMPLE_LENGTH_SOFT   int32 = C.AL_SAMPLE_LENGTH_SOFT
	SEC_LENGTH_SOFT      int32 = C.AL_SEC_LENGTH_SOFT

	SOFT_direct_channels int32 = C.AL_SOFT_direct_channels
	DIRECT_CHANNELS_SOFT int32 = C.AL_DIRECT_CHANNELS_SOFT

	ALC_SOFT_loopback        int32 = C.ALC_SOFT_loopback
	ALC_FORMAT_CHANNELS_SOFT int32 = C.ALC_FORMAT_CHANNELS_SOFT
	ALC_FORMAT_TYPE_SOFT     int32 = C.ALC_FORMAT_TYPE_SOFT

	// Sample types
	ALC_BYTE_SOFT           int32 = C.ALC_BYTE_SOFT
	ALC_UNSIGNED_BYTE_SOFT  int32 = C.ALC_UNSIGNED_BYTE_SOFT
	ALC_SHORT_SOFT          int32 = C.ALC_SHORT_SOFT
	ALC_UNSIGNED_SHORT_SOFT int32 = C.ALC_UNSIGNED_SHORT_SOFT
	ALC_INT_SOFT            int32 = C.ALC_INT_SOFT
	ALC_UNSIGNED_INT_SOFT   int32 = C.ALC_UNSIGNED_INT_SOFT
	ALC_FLOAT_SOFT          int32 = C.ALC_FLOAT_SOFT

	// Channel configurations
	ALC_MONO_SOFT    int32 = C.ALC_MONO_SOFT
	ALC_STEREO_SOFT  int32 = C.ALC_STEREO_SOFT
	ALC_QUAD_SOFT    int32 = C.ALC_QUAD_SOFT
	ALC_5POINT1_SOFT int32 = C.ALC_5POINT1_SOFT
	ALC_6POINT1_SOFT int32 = C.ALC_6POINT1_SOFT
	ALC_7POINT1_SOFT int32 = C.ALC_7POINT1_SOFT

	EXT_STEREO_ANGLES int32 = C.AL_EXT_STEREO_ANGLES
	STEREO_ANGLES     int32 = C.AL_STEREO_ANGLES

	EXT_SOURCE_RADIUS int32 = C.AL_EXT_SOURCE_RADIUS
	SOURCE_RADIUS     int32 = C.AL_SOURCE_RADIUS

	SOFT_source_latency        int32 = C.AL_SOFT_source_latency
	SAMPLE_OFFSET_LATENCY_SOFT int32 = C.AL_SAMPLE_OFFSET_LATENCY_SOFT
	SEC_OFFSET_LATENCY_SOFT    int32 = C.AL_SEC_OFFSET_LATENCY_SOFT
)

Variables

View Source
var (
	ErrInvalidName      = errors.New("openal: invalid name parameter")
	ErrInvalidEnum      = errors.New("openal: invalid enum parameter")
	ErrInvalidValue     = errors.New("openal: invalid value parameter")
	ErrInvalidOperation = errors.New("openal: invalid operation")
	ErrOutOfMemory      = errors.New("openal: out of memory")

	ErrCantOpenDevice         = errors.New("openal: cant open device")
	ErrCantCreateContext      = errors.New("openal: cant create context")
	ErrCantMakeContextCurrent = errors.New("openal: cant make context current")
)

Functions

func AlcGetIntegerv

func AlcGetIntegerv(d *Device, param, size int32, values *int32)

func AlcGetRawString

func AlcGetRawString(d *Device, param int32) uintptr

func AlcGetString

func AlcGetString(d *Device, param int32) string

func ErrorHandler

func ErrorHandler() func(error)

func SetErrorHandler

func SetErrorHandler(f func(error))

func StringList

func StringList(raw uintptr) []string

StringList splits a string list. It must be NUL seperated with two NULs at the end.

Types

type Device

type Device struct {
	// contains filtered or unexported fields
}

func OpenDevice

func OpenDevice(name string, ctxAttribs []int32) (*Device, error)

OpenDevice opens the named device (or "" for the default device).

func (*Device) AlcGetEnumValue

func (d *Device) AlcGetEnumValue(name string) int32

func (*Device) AlcGetIntegerv

func (d *Device) AlcGetIntegerv(param int32, size int32, values *int32)

func (*Device) AlcGetProcAddress

func (d *Device) AlcGetProcAddress(name string) unsafe.Pointer

func (*Device) AlcGetRawString

func (d *Device) AlcGetRawString(param int32) uintptr

func (*Device) AlcGetString

func (d *Device) AlcGetString(param int32) string

func (*Device) AlcIsExtensionPresent

func (d *Device) AlcIsExtensionPresent(name string) bool

func (*Device) Buffer3f

func (d *Device) Buffer3f(buffer uint32, param int32, value1, value2, value3 float32)

func (*Device) Buffer3i

func (d *Device) Buffer3i(buffer uint32, param int32, value1, value2, value3 int32)

func (*Device) BufferData

func (d *Device) BufferData(buffer uint32, format int32, data unsafe.Pointer, size, freq int32)

func (*Device) BufferDataStatic

func (d *Device) BufferDataStatic(buffer uint32, format int32, data unsafe.Pointer, length, freq int32)

func (*Device) BufferSamplesSOFT

func (d *Device) BufferSamplesSOFT(buffer uint32, sampleRate uint32, internalFormat, samples, channels, t int32, data unsafe.Pointer)

func (*Device) BufferSubDataSOFT

func (d *Device) BufferSubDataSOFT(buffer uint32, format int32, data unsafe.Pointer, offset, length int32)

func (*Device) BufferSubSamplesSOFT

func (d *Device) BufferSubSamplesSOFT(buffer uint32, offset, samples, channels, t int32, data unsafe.Pointer)

func (*Device) Bufferf

func (d *Device) Bufferf(buffer uint32, param int32, value float32)

func (*Device) Bufferfv

func (d *Device) Bufferfv(buffer uint32, param int32, values *float32)

func (*Device) Bufferi

func (d *Device) Bufferi(buffer uint32, param int32, value int32)

func (*Device) Bufferiv

func (d *Device) Bufferiv(buffer uint32, param int32, values *int32)

func (*Device) CaptureSamples

func (d *Device) CaptureSamples(buffer unsafe.Pointer, n int32)

CaptureSamples fills the buffer with n audio samples.

This function will panic if the device is not yet initialized for capturing audo samples via the InitCapture() method.

This function will panic if the device was already closed via the Close() method.

func (*Device) Close

func (d *Device) Close()

Close closes the device. This function will panic if all of the device's associated buffers have not been destroyed (indicating a programmer fault).

This function will panic if the device was already closed via the Close() method.

func (*Device) DeleteBuffers

func (d *Device) DeleteBuffers(n int32, buffers *uint32)

func (*Device) DeleteSources

func (d *Device) DeleteSources(n int32, sources *uint32)

func (*Device) Disable

func (d *Device) Disable(capability int32)

func (*Device) DistanceModel

func (d *Device) DistanceModel(distanceModel int32)

func (*Device) DopplerFactor

func (d *Device) DopplerFactor(value float32)

func (*Device) DopplerVelocity

func (d *Device) DopplerVelocity(value float32)

func (*Device) Enable

func (d *Device) Enable(capability int32)

func (*Device) GenBuffers

func (d *Device) GenBuffers(n int32, buffers *uint32)

func (*Device) GenSources

func (d *Device) GenSources(n int32, sources *uint32)

func (*Device) GetBoolean

func (d *Device) GetBoolean(param int32) bool

func (*Device) GetBooleanv

func (d *Device) GetBooleanv(param int32, values *uint8)

func (*Device) GetBuffer3f

func (d *Device) GetBuffer3f(buffer uint32, param int32, value1, value2, value3 *float32)

func (*Device) GetBuffer3i

func (d *Device) GetBuffer3i(buffer uint32, param int32, value1, value2, value3 *int32)

func (*Device) GetBufferSamplesSOFT

func (d *Device) GetBufferSamplesSOFT(buffer uint32, offset, samples, channels, t int32, data unsafe.Pointer)

func (*Device) GetBufferf

func (d *Device) GetBufferf(buffer uint32, param int32, value *float32)

func (*Device) GetBufferfv

func (d *Device) GetBufferfv(buffer uint32, param int32, values *float32)

func (*Device) GetBufferi

func (d *Device) GetBufferi(buffer uint32, param int32, value *int32)

func (*Device) GetBufferiv

func (d *Device) GetBufferiv(buffer uint32, param int32, values *int32)

func (*Device) GetDouble

func (d *Device) GetDouble(param int32) float64

func (*Device) GetDoublev

func (d *Device) GetDoublev(param int32, values *float64)

func (*Device) GetEnumValue

func (d *Device) GetEnumValue(name string) int32

func (*Device) GetFloat

func (d *Device) GetFloat(param int32) float32

func (*Device) GetFloatv

func (d *Device) GetFloatv(param int32, values *float32)

func (*Device) GetInteger

func (d *Device) GetInteger(param int32) int32

func (*Device) GetIntegerv

func (d *Device) GetIntegerv(param int32, values *int32)

func (*Device) GetListener3f

func (d *Device) GetListener3f(param int32, value1, value2, value3 *float32)

func (*Device) GetListener3i

func (d *Device) GetListener3i(param int32, value1, value2, value3 *int32)

func (*Device) GetListenerf

func (d *Device) GetListenerf(param int32, value *float32)

func (*Device) GetListenerfv

func (d *Device) GetListenerfv(param int32, values *float32)

func (*Device) GetListeneri

func (d *Device) GetListeneri(param int32, value *int32)

func (*Device) GetListeneriv

func (d *Device) GetListeneriv(param int32, values *int32)

func (*Device) GetProcAddress

func (d *Device) GetProcAddress(name string) unsafe.Pointer

func (*Device) GetSource3dSOFT

func (d *Device) GetSource3dSOFT(source uint32, param int32, value1, value2, value3 *float64)

func (*Device) GetSource3f

func (d *Device) GetSource3f(source uint32, param int32, value1, value2, value3 *float32)

func (*Device) GetSource3i

func (d *Device) GetSource3i(source uint32, param int32, value1, value2, value3 *int32)

func (*Device) GetSource3i64SOFT

func (d *Device) GetSource3i64SOFT(source uint32, param int32, value1, value2, value3 *int64)

func (*Device) GetSourcedSOFT

func (d *Device) GetSourcedSOFT(source uint32, param int32, value *float64)

func (*Device) GetSourcedvSOFT

func (d *Device) GetSourcedvSOFT(source uint32, param int32, values *float64)

func (*Device) GetSourcef

func (d *Device) GetSourcef(source uint32, param int32, value *float32)

func (*Device) GetSourcefv

func (d *Device) GetSourcefv(source uint32, param int32, values *float32)

func (*Device) GetSourcei

func (d *Device) GetSourcei(source uint32, param int32, value *int32)

func (*Device) GetSourcei64SOFT

func (d *Device) GetSourcei64SOFT(source uint32, param int32, value *int64)

func (*Device) GetSourcei64vSOFT

func (d *Device) GetSourcei64vSOFT(source uint32, param int32, values *int64)

func (*Device) GetSourceiv

func (d *Device) GetSourceiv(source uint32, param int32, values *int32)

func (*Device) GetString

func (d *Device) GetString(param int32) string

func (*Device) InitCapture

func (d *Device) InitCapture(frequency uint32, format, bufferSize int32) error

InitCapture initializes this device for capturing audio samples.

func (*Device) IsBuffer

func (d *Device) IsBuffer(buffer uint32) bool

func (*Device) IsBufferFormatSupportedSOFT

func (d *Device) IsBufferFormatSupportedSOFT(format int32) bool

func (*Device) IsEnabled

func (d *Device) IsEnabled(capability int32) bool

func (*Device) IsExtensionPresent

func (d *Device) IsExtensionPresent(name string) bool

func (*Device) IsSource

func (d *Device) IsSource(source uint32) bool

func (*Device) Listener3f

func (d *Device) Listener3f(param int32, value1, value2, value3 float32)

func (*Device) Listener3i

func (d *Device) Listener3i(param int32, value1, value2, value3 int32)

func (*Device) Listenerf

func (d *Device) Listenerf(param int32, value float32)

func (*Device) Listenerfv

func (d *Device) Listenerfv(param int32, values *float32)

func (*Device) Listeneri

func (d *Device) Listeneri(param int32, value int32)

func (*Device) Listeneriv

func (d *Device) Listeneriv(param int32, values *int32)

func (*Device) Source3dSOFT

func (d *Device) Source3dSOFT(source uint32, param int32, value1, value2, value3 float64)

func (*Device) Source3f

func (d *Device) Source3f(source uint32, param int32, value1, value2, value3 float32)

func (*Device) Source3i

func (d *Device) Source3i(source uint32, param int32, value1, value2, value3 int32)

func (*Device) Source3i64SOFT

func (d *Device) Source3i64SOFT(source uint32, param int32, value1, value2, value3 int64)

func (*Device) SourcePause

func (d *Device) SourcePause(source uint32)

func (*Device) SourcePausev

func (d *Device) SourcePausev(sources []uint32)

func (*Device) SourcePlay

func (d *Device) SourcePlay(source uint32)

func (*Device) SourcePlayv

func (d *Device) SourcePlayv(sources []uint32)

func (*Device) SourceQueueBuffers

func (d *Device) SourceQueueBuffers(source uint32, buffers []uint32)

func (*Device) SourceRewind

func (d *Device) SourceRewind(source uint32)

func (*Device) SourceRewindv

func (d *Device) SourceRewindv(sources []uint32)

func (*Device) SourceStop

func (d *Device) SourceStop(source uint32)

func (*Device) SourceStopv

func (d *Device) SourceStopv(sources []uint32)

func (*Device) SourceUnqueueBuffers

func (d *Device) SourceUnqueueBuffers(source uint32, buffers []uint32)

func (*Device) SourcedSOFT

func (d *Device) SourcedSOFT(source uint32, param int32, value float64)

func (*Device) SourcedvSOFT

func (d *Device) SourcedvSOFT(source uint32, param int32, values *float64)

func (*Device) Sourcef

func (d *Device) Sourcef(source uint32, param int32, value float32)

func (*Device) Sourcefv

func (d *Device) Sourcefv(source uint32, param int32, values *float32)

func (*Device) Sourcei

func (d *Device) Sourcei(source uint32, param int32, value int32)

func (*Device) Sourcei64SOFT

func (d *Device) Sourcei64SOFT(source uint32, param int32, value int64)

func (*Device) Sourcei64vSOFT

func (d *Device) Sourcei64vSOFT(source uint32, param int32, values *int64)

func (*Device) Sourceiv

func (d *Device) Sourceiv(source uint32, param int32, values *int32)

func (*Device) SpeedOfSound

func (d *Device) SpeedOfSound(value float32)

func (*Device) StartCapture

func (d *Device) StartCapture()

StartCapture starts capturing on this device.

This function will panic if the device is not yet initialized for capturing audo samples via the InitCapture() method.

This function will panic if the device was already closed via the Close() method.

func (*Device) StopCapture

func (d *Device) StopCapture()

StopCapture stops capturing on this device.

This function will panic if the device is not yet initialized for capturing audo samples via the InitCapture() method.

This function will panic if the device was already closed via the Close() method.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL