mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-12-24 02:38:53 +01:00
audio: Start implementing with OpenAL (not finished yet)
This commit is contained in:
parent
2d5ac9e987
commit
a8e3b2b619
@ -110,7 +110,6 @@ func loadChannelBuffers() (l, r []float32) {
|
||||
inputL[i] += ch.l[i]
|
||||
inputR[i] += ch.r[i]
|
||||
}
|
||||
// TODO: Use copyFromChannel?
|
||||
usedLen := min(bufferSize, len(ch.l))
|
||||
ch.l = ch.l[usedLen:]
|
||||
ch.r = ch.r[usedLen:]
|
||||
|
@ -16,8 +16,27 @@
|
||||
|
||||
package audio
|
||||
|
||||
import (
|
||||
"github.com/timshannon/go-openal/openal"
|
||||
"runtime"
|
||||
)
|
||||
|
||||
func initialize() {
|
||||
// TODO: Implement
|
||||
ch := make(chan struct{})
|
||||
go func() {
|
||||
runtime.LockOSThread()
|
||||
|
||||
device := openal.OpenDevice("")
|
||||
context := device.CreateContext()
|
||||
context.Activate()
|
||||
|
||||
buffer := openal.NewBuffer()
|
||||
//buffer.SetData(openal.FormatStereo16)
|
||||
_ = buffer
|
||||
|
||||
close(ch)
|
||||
}()
|
||||
<-ch
|
||||
}
|
||||
|
||||
func start() {
|
||||
|
Loading…
Reference in New Issue
Block a user