diff --git a/audio.go b/audio.go index 1a61c53..d32c5a0 100644 --- a/audio.go +++ b/audio.go @@ -1,8 +1,8 @@ package sointu -// AudioSink represents something where we can send audio e.g. audio output. +// 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 AudioSink interface { +type AudioOutput interface { WriteAudio(buffer []float32) error Close() error } @@ -11,9 +11,9 @@ type AudioSink interface { // 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 AudioSinks with Output(); each can -// be used to output separate sound & closed when done. +// 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() AudioSink + Output() AudioOutput Close() error } diff --git a/oto/oto.go b/oto/oto.go index d4ccd29..0d24ee3 100644 --- a/oto/oto.go +++ b/oto/oto.go @@ -13,7 +13,7 @@ type OtoOutput struct { tmpBuffer []byte } -func (c *OtoContext) Output() sointu.AudioSink { +func (c *OtoContext) Output() sointu.AudioOutput { return &OtoOutput{player: (*oto.Context)(c).NewPlayer(), tmpBuffer: make([]byte, 0)} }