Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewPassThrough ¶
func NewPassThrough(chunks <-chan pkg.AudioChunk) text_to_speech.Transcoder
Types ¶
type Linear16ToOpus ¶
type Linear16ToOpus struct {
// contains filtered or unexported fields
}
Linear16ToOpus converts Linear16 (little‑endian 16‑bit PCM) to Opus in real time. Pointers returned by Packets() remain valid only until the next read — copy if you need to keep them.
func (*Linear16ToOpus) Chunks ¶
func (s *Linear16ToOpus) Chunks() <-chan pkg.AudioChunk
Chunks yields encoded Opus packets. Close when Run() returns.
func (*Linear16ToOpus) Clear ¶
func (s *Linear16ToOpus) Clear()
func (*Linear16ToOpus) Err ¶
func (s *Linear16ToOpus) Err() <-chan error
Err returns a channel with the first terminal error.
type Linear16ToOpusBuilder ¶
type Linear16ToOpusBuilder struct {
// contains filtered or unexported fields
}
func NewLinear16ToOpusBuilder ¶
func NewLinear16ToOpusBuilder(sampleRate, channels int, opts *Linear16ToOpusOptions) (*Linear16ToOpusBuilder, error)
NewLinear16ToOpusBuilder builds a transcoder builder.
func (*Linear16ToOpusBuilder) BuildAndRunTranscoder ¶
func (b *Linear16ToOpusBuilder) BuildAndRunTranscoder(src <-chan pkg.AudioChunk) text_to_speech.Transcoder
BuildAndRunTranscoder starts transcoding and blocks until ctx.Done() or a fatal error.
type Linear16ToOpusOptions ¶
type Linear16ToOpusOptions struct {
FrameDuration time.Duration
BufferMillis int
Application opus.Application
}
Linear16ToOpusOptions tweaks behaviour. Zero values are sensible.
- FrameDuration — Opus frame size (2.5‑60 ms). 20 ms is good for VoIP.
- BufferMillis — depth of the internal jitter buffer in milliseconds.
- Application — opus.AppVoIP (default), opus.AppAudio, opus.AppRestrictedLowDelay.
type PassThrough ¶
type PassThrough struct {
// contains filtered or unexported fields
}
func (*PassThrough) Chunks ¶
func (t *PassThrough) Chunks() <-chan pkg.AudioChunk
func (*PassThrough) Clear ¶
func (t *PassThrough) Clear()