transport

package
v1.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 6, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewCall

func NewCall(ctx context.Context, cfg CallConfig) (*dialog.Session, *gateway.Client, error)

NewCall builds a dialog session and dialog-plane gateway client.

Types

type CallConfig

type CallConfig struct {
	CallID     string
	DialogURL  string
	Meta       dialog.StartMeta
	Factory    SessionFactory
	OnAudioOut func([]byte) error

	InputCodec    string
	OutputCodec   string
	PCMSampleRate int
	Denoiser      asr.Denoiser
	TTSCache      *tts.CacheConfig

	Gateway gateway.ClientConfig

	OnHangup func(reason string)
	OnTurn   func(dialog.TurnEvent)
}

CallConfig wires dialog.Session + gateway.Client for one media call.

type SessionFactory

type SessionFactory interface {
	NewASR(ctx context.Context, callID string) (engine asr.Engine, sampleRate int, err error)
	NewTTS(ctx context.Context, callID string) (svc tts.TTSService, sampleRate int, err error)
}

SessionFactory mints per-call ASR engine and TTS service instances.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL