sointu/audio.go
vsariola 1a5251dbf6 refactor(sointu): change the name of AudioSink into AudioOutput
The interface is never used as anything else as Output so trying to generalize as something more vague like Sink made no sense.
2021-08-30 23:11:33 +03:00

20 lines
671 B
Go

package sointu
// AudioOutput represents something where we can send audio e.g. audio output.
// WriteAudio should block if not ready to accept audio e.g. buffer full.
type AudioOutput interface {
WriteAudio(buffer []float32) error
Close() error
}
// AudioContext represents the low-level audio drivers. There should be at most
// one AudioContext at a time. The interface is implemented at least by
// oto.OtoContext, but in future we could also mock it.
//
// AudioContext is used to create one or more AudioOutputs with Output(); each
// can be used to output separate sound & closed when done.
type AudioContext interface {
Output() AudioOutput
Close() error
}