refactor: AudioSource is a func instead of single function interface

This avoids defining Processor altogether.
This commit is contained in:
5684185+vsariola@users.noreply.github.com
2024-11-02 19:50:20 +02:00
parent 3eb4d86d52
commit 2aa0aaee0c
4 changed files with 18 additions and 30 deletions

View File

@ -77,7 +77,7 @@ func (o *OtoReader) Read(b []byte) (n int, err error) {
} else if samples < len(o.tmpBuffer) {
o.tmpBuffer = o.tmpBuffer[:samples]
}
err = o.audioSource.ReadAudio(o.tmpBuffer)
err = o.audioSource(o.tmpBuffer)
if err != nil {
return o.closeWithError(err)
}