genesys

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: May 16, 2026 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Package genesys provides Genesys AudioHook WebSocket protocol serializer. Protocol: text = JSON (open/opened/close/closed/ping/pong/update/event), binary = PCMU at 8kHz.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Params

type Params struct {
	GenesysSampleRate int
	SampleRate        int
	MediaFormat       string
}

Params configures the Genesys serializer.

type Serializer

type Serializer struct {
	SampleRate  int
	GenesysRate int
	MediaFormat string // "PCMU" or "L16"
	// contains filtered or unexported fields
}

Serializer implements serialize.Serializer, SerializerWithSetup, and SerializerWithMessageType for Genesys AudioHook.

func NewSerializer

func NewSerializer(params *Params) *Serializer

NewSerializer returns a Genesys AudioHook serializer.

func (*Serializer) CreateOpenedResponse

func (s *Serializer) CreateOpenedResponse(startPaused bool, supportedLanguages []string, selectedLanguage string) ([]byte, error)

CreateOpenedResponse builds the "opened" JSON response for the client (caller sends via transport).

func (*Serializer) CreatePongResponse

func (s *Serializer) CreatePongResponse() ([]byte, error)

CreatePongResponse builds the "pong" response for ping.

func (*Serializer) Deserialize

func (s *Serializer) Deserialize(data []byte) (frames.Frame, error)

Deserialize implements serialize.Serializer. Binary = PCMU audio; text = JSON (open/opened/close/closed/ping/pong/event).

func (*Serializer) Serialize

func (s *Serializer) Serialize(f frames.Frame) ([]byte, error)

Serialize implements serialize.Serializer.

func (*Serializer) SerializeWithType

func (s *Serializer) SerializeWithType(f frames.Frame) ([]byte, bool, error)

SerializeWithType implements serialize.SerializerWithMessageType (audio = binary, control = text).

func (*Serializer) Setup

func (s *Serializer) Setup(start *frames.StartFrame)

Setup implements serialize.SerializerWithSetup.

Jump to

Keyboard shortcuts

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