mirror of
https://github.com/vsariola/sointu.git
synced 2025-05-28 03:10:24 -04:00
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.
This commit is contained in:
parent
eda48491e2
commit
1a5251dbf6
10
audio.go
10
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
|
||||
}
|
||||
|
@ -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)}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user