func LoadMemoryWaveform(waveshape al.ALenum, frequency float32, phase float32, duration float32) ( format al.ALenum, size int32, freq float32, data unsafe.Pointer) { data = C.alutLoadMemoryWaveform( C.ALenum(waveshape), C.ALfloat(frequency), C.ALfloat(phase), C.ALfloat(duration), (*C.ALenum)(&format), (*C.ALsizei)(&size), (*C.ALfloat)(&frequency), ) return }
func CreateBufferWavefrom( waveshape al.ALenum, frequency float32, phase float32, duration float32, ) al.Buffer { return al.Buffer(C.alutCreateBufferWaveform( C.ALenum(waveshape), C.ALfloat(frequency), C.ALfloat(phase), C.ALfloat(duration), )) }
// Play will play the sound at a given position, the falloff distance in which the sound's volume is cut in half, // and the volume ( 1.0 is normal volume, 0 is silence ) // It will return the PlayInstance that can be used to stop the source while playing // Remember that in order for the 3D audio to work properly that the audio needs to be all in one channel, not stereo! func (s *Sound) Play3D(x, y, z, falloff, volume float32) (request PlayInstance) { source, err := requestSource() if err != nil { return request } C.alSourcef(source.id, C.AL_GAIN, C.ALfloat(volume)) C.alSourcei(source.id, C.AL_SOURCE_RELATIVE, C.AL_FALSE) C.alSourcef(source.id, C.AL_REFERENCE_DISTANCE, C.ALfloat(falloff)) C.alSource3f(source.id, C.AL_POSITION, C.ALfloat(x), C.ALfloat(y), C.ALfloat(z)) C.alSourcei(source.id, C.AL_BUFFER, C.ALint(s.buffer)) source.setToPlay() request.id = source.requestId request.src = source return request }
// Play will play the sound. Volume ( 1.0 is normal volume, 0 is silence ) // Returns the PlayInstance that can be used to stop the source while playing func (s *Sound) Play(volume float32) (request PlayInstance) { source, err := requestSource() if err != nil { return request } C.alSourcef(source.id, C.AL_GAIN, C.ALfloat(volume)) C.alSourcei(source.id, C.AL_SOURCE_RELATIVE, C.AL_TRUE) C.alSource3f(source.id, C.AL_POSITION, 0, 0, 0) C.alSourcei(source.id, C.AL_BUFFER, C.ALint(s.buffer)) source.setToPlay() request.id = source.requestId request.src = source return request }
// Renamed, was Buffer3f. func (self Buffer) set3f(param int32, value1, value2, value3 float32) { C.alBuffer3f(C.ALuint(self), C.ALenum(param), C.ALfloat(value1), C.ALfloat(value2), C.ALfloat(value3)) }
// Renamed, was Bufferf. func (self Buffer) setf(param int32, value float32) { C.alBufferf(C.ALuint(self), C.ALenum(param), C.ALfloat(value)) }
func (source Source) Source3f( param ALenum, value1, value2, value3 float32) { C.alSource3f( C.ALuint(source), C.ALenum(param), C.ALfloat(value1), C.ALfloat(value2), C.ALfloat(value3)) }
func Listener3f(param ALenum, value1, value2, value3 float32) { C.alListener3f(C.ALenum(param), C.ALfloat(value1), C.ALfloat(value2), C.ALfloat(value3)) }
// Renamed, was Listener3f. func (self Listener) Set3f(param int32, value1, value2, value3 float32) { C.alListener3f(C.ALenum(param), C.ALfloat(value1), C.ALfloat(value2), C.ALfloat(value3)) }
func SpeedOfSound(value float32) { C.alSpeedOfSound(C.ALfloat(value)) }
/* * Global Parameters */ func DopplerFactor(value float32) { C.alDopplerFactor(C.ALfloat(value)) }
func alSpeedOfSound(v float32) { C.alSpeedOfSound(C.ALfloat(v)) }
func alDopplerVelocity(v float32) { C.alDopplerVelocity(C.ALfloat(v)) }
func alDopplerFactor(v float32) { C.alDopplerFactor(C.ALfloat(v)) }
func alListenerf(k int, v float32) { C.alListenerf(C.ALenum(k), C.ALfloat(v)) }
func alSourcef(s Source, k int, v float32) { C.alSourcef(C.ALuint(s), C.ALenum(k), C.ALfloat(v)) }
func SetListenerGain(val float32) error { C.alListenerf(C.AL_GAIN, C.ALfloat(C.float(val))) return GetError() }
// Renamed, was Sourcef. func (self Source) Setf(param int32, value float32) { C.alSourcef(C.ALuint(self), C.ALenum(param), C.ALfloat(value)) }
// Renamed, was Source3f. func (self Source) Set3f(param int32, value1, value2, value3 float32) { C.alSource3f(C.ALuint(self), C.ALenum(param), C.ALfloat(value1), C.ALfloat(value2), C.ALfloat(value3)) }
func SetListenPosition(x, y, z float32) { C.alListener3f(C.AL_POSITION, C.ALfloat(x), C.ALfloat(y), C.ALfloat(z)) }
func DopplerVelocity(value float32) { C.alDopplerVelocity(C.ALfloat(value)) }
func alDopplerVelocity(v float32) { C.call_alDopplerVelocity(alDopplerVelocityFunc, C.ALfloat(v)) }
// Renamed, was Listenerf. func (self Listener) Setf(param int32, value float32) { C.alListenerf(C.ALenum(param), C.ALfloat(value)) }
func alSourcef(s Source, k int, v float32) { C.call_alSourcef(alSourcefFunc, C.ALuint(s), C.ALenum(k), C.ALfloat(v)) }
func alDopplerFactor(v float32) { C.call_alDopplerFactor(alDopplerFactorFunc, C.ALfloat(v)) }
/* * Set Listener parameters */ func Listenerf(param ALenum, value float32) { C.alListenerf(C.ALenum(param), C.ALfloat(value)) }
func alSpeedOfSound(v float32) { C.call_alSpeedOfSound(alSpeedOfSoundFunc, C.ALfloat(v)) }
func Sleep(duration float32) { C.alutSleep(C.ALfloat(duration)) }
func alListenerf(k int, v float32) { C.call_alListenerf(alListenerfFunc, C.ALenum(k), C.ALfloat(v)) }
/* * Set Source parameters */ func (source Source) Sourcef(param ALenum, value float32) { C.alSourcef(C.ALuint(source), C.ALenum(param), C.ALfloat(value)) }