MCPcopy
hub / github.com/ebitengine/oto / loop

Method loop

driver_windows.go:137–149  ·  view source on GitHub ↗
(sampleRate int, channelCount int, mux *mux.Mux)

Source from the content-addressed store, hash-verified

135}
136
137func (c *nullContext) loop(sampleRate int, channelCount int, mux *mux.Mux) {
138 var buf32 [4096]float32
139 sleep := time.Duration(float64(time.Second) * float64(len(buf32)) / float64(channelCount) / float64(sampleRate))
140 for {
141 if c.suspended {
142 time.Sleep(time.Second)
143 continue
144 }
145
146 mux.ReadFloat32s(buf32[:])
147 time.Sleep(sleep)
148 }
149}
150
151func (c *nullContext) Suspend() error {
152 c.suspended = true

Callers 1

newNullContextFunction · 0.95

Calls 1

ReadFloat32sMethod · 0.80

Tested by

no test coverage detected