mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-11-10 04:57:26 +01:00
audio: Use the new oto API
This commit is contained in:
parent
fadbf01826
commit
3b9e6c2708
@ -220,8 +220,9 @@ func (c *Context) Update() error {
|
|||||||
// is unexpectable.
|
// is unexpectable.
|
||||||
// e.g. a variable for JVM on Android might not be set.
|
// e.g. a variable for JVM on Android might not be set.
|
||||||
if c.driver == nil {
|
if c.driver == nil {
|
||||||
// TODO: Rename this other than player
|
// The buffer size is 1/20 sec.
|
||||||
p, err := oto.NewPlayer(c.sampleRate, channelNum, bytesPerSample)
|
s := c.sampleRate * channelNum * bytesPerSample / 20
|
||||||
|
p, err := oto.NewPlayer(c.sampleRate, channelNum, bytesPerSample, s)
|
||||||
c.driver = p
|
c.driver = p
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
|
Loading…
Reference in New Issue
Block a user