(sampleRate int, channelCount int, format mux.Format, bufferSizeInBytes int)
| 24 | } |
| 25 | |
| 26 | func newContext(sampleRate int, channelCount int, format mux.Format, bufferSizeInBytes int) (*context, chan struct{}, error) { |
| 27 | ready := make(chan struct{}) |
| 28 | close(ready) |
| 29 | |
| 30 | c := &context{ |
| 31 | mux: mux.New(sampleRate, channelCount, format), |
| 32 | } |
| 33 | if err := oboe.Play(sampleRate, channelCount, c.mux.ReadFloat32s, bufferSizeInBytes); err != nil { |
| 34 | return nil, nil, err |
| 35 | } |
| 36 | return c, ready, nil |
| 37 | } |
| 38 | |
| 39 | func (c *context) Suspend() error { |
| 40 | return oboe.Suspend() |