import "golang.org/x/mobile/exp/audio/al"
Package al provides OpenAL Soft bindings for Go.
Calls are not safe for concurrent use.
More information about OpenAL Soft is available at http://www.openal.org/documentation/openal-1.1-specification.pdf.
In order to use this package on Linux desktop distros, you will need OpenAL library as an external dependency. On Ubuntu 14.04 'Trusty', you may have to install this library by running the command below.
sudo apt-get install libopenal-dev
When compiled for Android, this package uses OpenAL Soft. Please add its license file to the open source notices of your application. OpenAL Soft's license file could be found at http://repo.or.cz/w/openal-soft.git/blob/HEAD:/COPYING.
al.go al_notandroid.go alc.go alc_notandroid.go const.go
const ( InvalidName = 0xA001 InvalidEnum = 0xA002 InvalidValue = 0xA003 InvalidOperation = 0xA004 OutOfMemory = 0xA005 )
Error returns one of these error codes.
const ( InverseDistance = 0xD001 InverseDistanceClamped = 0xD002 LinearDistance = 0xD003 LinearDistanceClamped = 0xD004 ExponentDistance = 0xD005 ExponentDistanceClamped = 0xD006 )
Distance models.
const ( Initial = 0x1011 Playing = 0x1012 Paused = 0x1013 Stopped = 0x1014 )
A source could be in the state of initial, playing, paused or stopped.
const ( FormatMono8 = 0x1100 FormatMono16 = 0x1101 FormatStereo8 = 0x1102 FormatStereo16 = 0x1103 )
Audio formats. Buffer.BufferData accepts one of these formats as the data format.
const CapabilityDistanceModel = Capability(0x200)
CapabilityDistanceModel represents the capability of specifying a different distance model for each source.
func CloseDevice()
CloseDevice closes the device and frees related resources. Calls to CloseDevice are safe for concurrent use.
DeleteBuffers deletes the buffers.
DeleteSources deletes the sources.
DeviceError returns the last known error from the current device.
func Disable(c Capability)
Disable disables a capability.
DistanceModel returns the distance model.
DopplerFactor returns the doppler factor.
DopplerVelocity returns the doppler velocity.
func Enable(c Capability)
Enable enables a capability.
func Enabled(c Capability) bool
Enabled returns true if the specified capability is enabled.
Error returns the most recently generated error.
Extensions returns the enabled extensions.
GenBuffers generates n new buffers. The generated buffers should be deleted once they are no longer in use.
GenSources generates n new sources. These sources should be deleted once they are not in use.
GetListenerf returns the float32 value of the listener parameter.
GetListenerfv returns the float32 vector value of the listener parameter.
GetString returns the string value of the given parameter.
Getb returns the bool value of the given parameter.
Getbv returns the bool vector value of the given parameter.
Getf returns the float32 value of the given parameter.
Getfv returns the float32 vector value of the given parameter.
Geti returns the int32 value of the given parameter.
Getiv returns the int32 vector value of the given parameter.
ListenerGain returns the total gain applied to the final mix.
OpenDevice opens the default audio device. Calls to OpenDevice are safe for concurrent use.
PauseSources pauses the sources.
PlaySources plays the sources.
Renderer returns the renderer information.
RewindSources rewinds the sources to their beginning positions.
SetDistanceModel sets the distance model.
SetDopplerFactor sets the doppler factor.
SetDopplerVelocity sets the doppler velocity.
SetListenerGain sets the total gain that will be applied to the final mix.
func SetListenerOrientation(v Orientation)
SetListenerOrientation sets the orientation of the listener.
SetListenerPosition sets the position of the listener.
SetListenerVelocity sets the velocity of the listener.
GetListenerf sets the float32 value for the listener parameter.
GetListenerf sets the float32 vector value of the listener parameter.
SetSpeedOfSound sets the speed of sound, its unit should be meters per second (m/s).
SpeedOfSound is the speed of sound in meters per second (m/s).
StopSources stops the sources.
Vendor returns the vendor.
Version returns the version string.
A buffer represents a chunk of PCM audio data that could be buffered to an audio source. A single buffer could be shared between multiple sources.
Bits return the number of bits used to represent a sample.
BufferData buffers PCM data to the current buffer.
Channels return the number of the audio channels.
Frequency returns the frequency of the buffer data in Hertz (Hz).
Geti returns the int32 value of the given parameter.
Size returns the size of the data.
Valid returns true if the buffer exists and is valid.
Capability represents OpenAL extension capabilities.
type Orientation struct { // Forward vector is the direction that the object is looking at. Forward Vector // Up vector represents the rotation of the object. Up Vector }
Orientation represents the angular position of an object in a right-handed Cartesian coordinate system. A cross product between the forward and up vector returns a vector that points to the right.
func ListenerOrientation() Orientation
ListenerOrientation returns the orientation of the listener.
Source represents an individual sound source in 3D-space. They take PCM data, apply modifications and then submit them to be mixed according to their spatial location.
BuffersProcessed returns the number of the processed buffers.
BuffersQueued returns the number of the queued buffers.
Gain returns the source gain.
Getf returns the float32 value of the given parameter.
Getfv returns the float32 vector value of the given parameter.
Geti returns the int32 value of the given parameter.
MaxGain returns the source's maximum gain setting.
MinGain returns the source's minimum gain setting.
OffsetByte returns the byte offset of the current playback position.
OffsetSample returns the sample offset of the current playback position.
OffsetSeconds returns the current playback position of the source in seconds.
func (s Source) Orientation() Orientation
Orientation returns the orientation of the source.
Position returns the position of the source.
QueueBuffers adds the buffers to the buffer queue.
SetGain sets the source gain.
SetMaxGain sets the source's maximum gain setting.
SetMinGain sets the source's minimum gain setting.
func (s Source) SetOrientation(o Orientation)
SetOrientation sets the orientation of the source.
SetPosition sets the position of the source.
SetVelocity sets the source's velocity.
Setf sets a float32 value for the given parameter.
Setfv sets a float32 vector value for the given parameter.
Seti sets an int32 value for the given parameter.
State returns the playing state of the source.
UnqueueBuffers removes the specified buffers from the buffer queue.
Velocity returns the source's velocity.
Vector represents an vector in a Cartesian coordinate system.
ListenerPosition returns the position of the listener.
ListenerVelocity returns the velocity of the listener.
Package al imports 4 packages (graph) and is imported by 5 packages. Updated 6 days ago. Refresh now. Tools for package owners.