(sampleRate int, channelCount int, mux *mux.Mux)
| 135 | } |
| 136 | |
| 137 | func (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 | |
| 151 | func (c *nullContext) Suspend() error { |
| 152 | c.suspended = true |
no test coverage detected