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 ¶
- type Params
- type Serializer
- func (s *Serializer) CreateOpenedResponse(startPaused bool, supportedLanguages []string, selectedLanguage string) ([]byte, error)
- func (s *Serializer) CreatePongResponse() ([]byte, error)
- func (s *Serializer) Deserialize(data []byte) (frames.Frame, error)
- func (s *Serializer) Serialize(f frames.Frame) ([]byte, error)
- func (s *Serializer) SerializeWithType(f frames.Frame) ([]byte, bool, error)
- func (s *Serializer) Setup(start *frames.StartFrame)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
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 ¶
SerializeWithType implements serialize.SerializerWithMessageType (audio = binary, control = text).
func (*Serializer) Setup ¶
func (s *Serializer) Setup(start *frames.StartFrame)
Setup implements serialize.SerializerWithSetup.