Skip to content

Commit

Permalink
Upgrade to otov3 and increase buffer size by 4x
Browse files Browse the repository at this point in the history
  • Loading branch information
unitoftime committed Oct 26, 2024
1 parent f8712da commit 97276b2
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 23 deletions.
2 changes: 1 addition & 1 deletion audio/audio.go
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ var MasterChannel *Channel

func Initialize() error {
err := speaker.Init(defaultSampleRate,
defaultSampleRate.N(time.Second/60)) // Buffer length of 1/60 of a second
4 * defaultSampleRate.N(time.Second/60)) // Buffer length of 4 * (1/60) of a second
if err != nil {
return err
}
Expand Down
2 changes: 0 additions & 2 deletions audio/loader.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@ import (
"github.com/unitoftime/beep"
"github.com/unitoftime/beep/vorbis"

// "github.com/unitoftime/beep/wav"

"github.com/unitoftime/flow/asset"
)

Expand Down
9 changes: 4 additions & 5 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ require (
github.com/ojrac/opensimplex-go v1.0.2
github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c
github.com/ungerik/go3d v0.0.0-20240502073936-1137f6adf7e9
github.com/unitoftime/beep v0.0.0-20230919175050-aed291a2afca
github.com/unitoftime/beep v0.0.0-20241026233918-b83e337289e8
github.com/unitoftime/ecs v0.0.1
github.com/unitoftime/glitch v0.0.0-20241014190205-a6252a015687
github.com/unitoftime/glitch v0.0.0-20241026230355-f78efeb88e93
github.com/unitoftime/gotiny v0.0.0-20240915162236-e7a35021e769
github.com/unitoftime/intmap v0.0.0-20231203115433-9505126f7096
github.com/unitoftime/packer v0.0.0-20230818221437-1f2c1b1e4275
Expand All @@ -21,16 +21,15 @@ require (
)

require (
github.com/ebitengine/oto/v3 v3.3.1 // indirect
github.com/ebitengine/purego v0.8.1 // indirect
github.com/go-gl/gl v0.0.0-20231021071112-07e5d0ea2e71 // indirect
github.com/go-gl/glfw/v3.3/glfw v0.0.0-20240506104042-037f3cc74f2a // indirect
github.com/hajimehoshi/oto v1.0.1 // indirect
github.com/jfreymuth/oggvorbis v1.0.5 // indirect
github.com/jfreymuth/vorbis v1.0.2 // indirect
github.com/kr/pretty v0.1.0 // indirect
github.com/pkg/errors v0.9.1 // indirect
github.com/unitoftime/cod v0.0.0-20240909130117-f553b1d09d22 // indirect
golang.org/x/exp/shiny v0.0.0-20241009180824-f66d83c29e7c // indirect
golang.org/x/mobile v0.0.0-20241004191011-08a83c5af9f8 // indirect
golang.org/x/sys v0.26.0 // indirect
gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 // indirect
)
23 changes: 8 additions & 15 deletions go.sum
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
github.com/ebitengine/oto/v3 v3.3.1 h1:d4McwGQuXOT0GL7bA5g9ZnaUEIEjQvG3hafzMy+T3qE=
github.com/ebitengine/oto/v3 v3.3.1/go.mod h1:MZeb/lwoC4DCOdiTIxYezrURTw7EvK/yF863+tmBI+U=
github.com/ebitengine/purego v0.8.1 h1:sdRKd6plj7KYW33EH5As6YKfe8m9zbN9JMrOjNVF/BE=
github.com/ebitengine/purego v0.8.1/go.mod h1:iIjxzd6CiRiOG0UyXP+V1+jWqUXVjPKLAI0mRfJZTmQ=
github.com/go-gl/gl v0.0.0-20231021071112-07e5d0ea2e71 h1:5BVwOaUSBTlVZowGO6VZGw2H/zl9nrd3eCZfYV+NfQA=
github.com/go-gl/gl v0.0.0-20231021071112-07e5d0ea2e71/go.mod h1:9YTyiznxEY1fVinfM7RvRcjRHbw2xLBJ3AAGIT0I4Nw=
github.com/go-gl/glfw/v3.3/glfw v0.0.0-20240506104042-037f3cc74f2a h1:vxnBhFDDT+xzxf1jTJKMKZw3H0swfWk9RpWbBbDK5+0=
Expand All @@ -6,8 +10,6 @@ github.com/go-gl/mathgl v1.1.0 h1:0lzZ+rntPX3/oGrDzYGdowSLC2ky8Osirvf5uAwfIEA=
github.com/go-gl/mathgl v1.1.0/go.mod h1:yhpkQzEiH9yPyxDUGzkmgScbaBVlhC06qodikEM0ZwQ=
github.com/golang/freetype v0.0.0-20170609003504-e2365dfdc4a0 h1:DACJavvAHhabrF08vX0COfcOBJRhZ8lUbR+ZWIs0Y5g=
github.com/golang/freetype v0.0.0-20170609003504-e2365dfdc4a0/go.mod h1:E/TSTwGwJL78qG/PmXZO1EjYhfJinVAhrmmHX6Z8B9k=
github.com/hajimehoshi/oto v1.0.1 h1:8AMnq0Yr2YmzaiqTg/k1Yzd6IygUGk2we9nmjgbgPn4=
github.com/hajimehoshi/oto v1.0.1/go.mod h1:wovJ8WWMfFKvP587mhHgot/MBr4DnNy9m6EepeVGnos=
github.com/jfreymuth/oggvorbis v1.0.5 h1:u+Ck+R0eLSRhgq8WTmffYnrVtSztJcYrl588DM4e3kQ=
github.com/jfreymuth/oggvorbis v1.0.5/go.mod h1:1U4pqWmghcoVsCJJ4fRBKv9peUJMBHixthRlBeD6uII=
github.com/jfreymuth/vorbis v1.0.2 h1:m1xH6+ZI4thH927pgKD8JOH4eaGRm18rEE9/0WKjvNE=
Expand All @@ -27,14 +29,14 @@ github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4=
github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
github.com/ungerik/go3d v0.0.0-20240502073936-1137f6adf7e9 h1:wMWP16Ijw+W+IXGcAzrwQDua1NBB4tP8iWECpg5DVRQ=
github.com/ungerik/go3d v0.0.0-20240502073936-1137f6adf7e9/go.mod h1:ipEjrk2uLK4xX8ivWBPIVOD0fMtKyPI0strluUfIlYQ=
github.com/unitoftime/beep v0.0.0-20230919175050-aed291a2afca h1:cc/JFL+F69OmZmMPrRK0P8wY0J2ePZRCRPWj8eXKt2I=
github.com/unitoftime/beep v0.0.0-20230919175050-aed291a2afca/go.mod h1:P1j3xRgms7eb4x95IaPENFqQ/7GCNx/KAgEfTPhPaq8=
github.com/unitoftime/beep v0.0.0-20241026233918-b83e337289e8 h1:Qm08cMaNAue7tl5u+0WwYho3Z8GSnSDkR56MwMCv3Ng=
github.com/unitoftime/beep v0.0.0-20241026233918-b83e337289e8/go.mod h1:P1j3xRgms7eb4x95IaPENFqQ/7GCNx/KAgEfTPhPaq8=
github.com/unitoftime/cod v0.0.0-20240909130117-f553b1d09d22 h1:81V+30jfwHH0wAsOVZ6gFCTWf1+XRdeJUMf0OgI0JG4=
github.com/unitoftime/cod v0.0.0-20240909130117-f553b1d09d22/go.mod h1:Iufibv9gn5GJb4Qzkf8e8xaXOV77OgkrB5kkBZTEN+M=
github.com/unitoftime/ecs v0.0.1 h1:xYxtSz99Ys5Cd/BgA54/ajC9Rp3t4tGmcM7Q8uIeDMc=
github.com/unitoftime/ecs v0.0.1/go.mod h1:3i8ercdQPj5M8lq9B3qGjywG7RRq0tBjbP/7THI5mtc=
github.com/unitoftime/glitch v0.0.0-20241014190205-a6252a015687 h1:CpcCn6EdqB3zdm6v4TfvbMDhy1sI5Dxh0gJ5v+5clds=
github.com/unitoftime/glitch v0.0.0-20241014190205-a6252a015687/go.mod h1:PgbLZ67AMiBoKS6FvFIVM0ANTRmU1wLKJEufxTsZ6vg=
github.com/unitoftime/glitch v0.0.0-20241026230355-f78efeb88e93 h1:ot7vHHNWhahzYT6bGtb2pyIjtuMELOC+GHm4NuJrgAo=
github.com/unitoftime/glitch v0.0.0-20241026230355-f78efeb88e93/go.mod h1:PgbLZ67AMiBoKS6FvFIVM0ANTRmU1wLKJEufxTsZ6vg=
github.com/unitoftime/gotiny v0.0.0-20240915162236-e7a35021e769 h1:SjK7DZ+RQcLLZwuz9bOLPW59fAZfadztDFDVg3nSiCE=
github.com/unitoftime/gotiny v0.0.0-20240915162236-e7a35021e769/go.mod h1:iq4kY4pPC8ZKztyei1pln4Fkk0BxQbyM1hICubHxoCo=
github.com/unitoftime/intmap v0.0.0-20231203115433-9505126f7096 h1:ietNpHDGnFAyabqzzinz8zJW2rjx/0DLslU4hU4wNbU=
Expand All @@ -43,20 +45,11 @@ github.com/unitoftime/packer v0.0.0-20230818221437-1f2c1b1e4275 h1:VvZkqMn5hGjSK
github.com/unitoftime/packer v0.0.0-20230818221437-1f2c1b1e4275/go.mod h1:x6IcVVrbVuX1lJo6tJHBUC3ym+5Ssf/sxqcXPCKwXXs=
github.com/zyedidia/generic v1.2.1 h1:Zv5KS/N2m0XZZiuLS82qheRG4X1o5gsWreGb0hR7XDc=
github.com/zyedidia/generic v1.2.1/go.mod h1:ly2RBz4mnz1yeuVbQA/VFwGjK3mnHGRj1JuoG336Bis=
golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
golang.org/x/exp v0.0.0-20241009180824-f66d83c29e7c h1:7dEasQXItcW1xKJ2+gg5VOiBnqWrJc+rq0DPKyvvdbY=
golang.org/x/exp v0.0.0-20241009180824-f66d83c29e7c/go.mod h1:NQtJDoLvd6faHhE7m4T/1IY708gDefGGjR/iUW8yQQ8=
golang.org/x/exp/shiny v0.0.0-20241009180824-f66d83c29e7c h1:jTMrjjZRcSH/BDxWhXCP6OWsfVgmnwI7J+F4/nyVXaU=
golang.org/x/exp/shiny v0.0.0-20241009180824-f66d83c29e7c/go.mod h1:3F+MieQB7dRYLTmnncoFbb1crS5lfQoTfDgQy6K4N0o=
golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js=
golang.org/x/image v0.0.0-20190321063152-3fc05d484e9f/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js=
golang.org/x/image v0.21.0 h1:c5qV36ajHpdj4Qi0GnE0jUc/yuo33OLFaa0d+crTD5s=
golang.org/x/image v0.21.0/go.mod h1:vUbsLavqK/W303ZroQQVKQ+Af3Yl6Uz1Ppu5J/cLz78=
golang.org/x/mobile v0.0.0-20190415191353-3e0bab5405d6/go.mod h1:E/iHnbuqvinMTCcRqshq8CkpyQDoeVncDDYHnLhea+o=
golang.org/x/mobile v0.0.0-20241004191011-08a83c5af9f8 h1:W8YtRRiKAvbIbqAh+xpWKecxEO8w1oaD6DrZhMyotF8=
golang.org/x/mobile v0.0.0-20241004191011-08a83c5af9f8/go.mod h1:snk1Mn2ZpdKCt90JPEsDh4sL3ReK520U2t0d7RHBnSU=
golang.org/x/sys v0.0.0-20190312061237-fead79001313/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20190429190828-d89cdac9e872/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.26.0 h1:KHjCJyddX0LoSTb3J+vWpupP9p0oznkqVk/IfjymZbo=
golang.org/x/sys v0.26.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
Expand Down

0 comments on commit 97276b2

Please sign in to comment.