本文整理汇总了Golang中C.ALfloat函数的典型用法代码示例。如果您正苦于以下问题:Golang ALfloat函数的具体用法?Golang ALfloat怎么用?Golang ALfloat使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了ALfloat函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。
示例1: LoadMemoryWaveform
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
}
示例2: CreateBufferWavefrom
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),
))
}
示例3: Play3D
// 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
}
示例4: Play
// 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
}
示例5: set3f
// 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))
}
示例6: setf
// Renamed, was Bufferf.
func (self Buffer) setf(param int32, value float32) {
C.alBufferf(C.ALuint(self), C.ALenum(param), C.ALfloat(value))
}
示例7: Source3f
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))
}
示例8: Listener3f
func Listener3f(param ALenum, value1, value2, value3 float32) {
C.alListener3f(C.ALenum(param), C.ALfloat(value1), C.ALfloat(value2), C.ALfloat(value3))
}
示例9: Set3f
// 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))
}
示例10: SpeedOfSound
func SpeedOfSound(value float32) {
C.alSpeedOfSound(C.ALfloat(value))
}
示例11: DopplerFactor
/*
* Global Parameters
*/
func DopplerFactor(value float32) {
C.alDopplerFactor(C.ALfloat(value))
}
示例12: alSpeedOfSound
func alSpeedOfSound(v float32) {
C.alSpeedOfSound(C.ALfloat(v))
}
示例13: alDopplerVelocity
func alDopplerVelocity(v float32) {
C.alDopplerVelocity(C.ALfloat(v))
}
示例14: alDopplerFactor
func alDopplerFactor(v float32) {
C.alDopplerFactor(C.ALfloat(v))
}
示例15: alListenerf
func alListenerf(k int, v float32) {
C.alListenerf(C.ALenum(k), C.ALfloat(v))
}