sb_audio

package
v0.5.5 Latest Latest
Warning

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

Go to latest
Published: Apr 4, 2022 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Channels_name = map[int32]string{
		0: "unknown",
		1: "mono",
		2: "stereo",
	}
	Channels_value = map[string]int32{
		"unknown": 0,
		"mono":    1,
		"stereo":  2,
	}
)

Enum value maps for Channels.

View Source
var (
	Codec_name = map[int32]string{
		0: "none",
		1: "opus",
		2: "pcm",
	}
	Codec_value = map[string]int32{
		"none": 0,
		"opus": 1,
		"pcm":  2,
	}
)

Enum value maps for Codec.

View Source
var File_audio_proto protoreflect.FileDescriptor

Functions

func NewServerEndpoints added in v0.5.0

func NewServerEndpoints() []*api.Endpoint

func RegisterServerHandler

func RegisterServerHandler(s server.Server, hdlr ServerHandler, opts ...server.HandlerOption) error

Types

type Capabilities

type Capabilities struct {
	Name                string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`                                                            // name of the server
	RxStreamAddress     string `protobuf:"bytes,2,opt,name=rx_stream_address,json=rxStreamAddress,proto3" json:"rx_stream_address,omitempty"`             // where the Server publishes audio from the radio
	TxStreamAddress     string `protobuf:"bytes,3,opt,name=tx_stream_address,json=txStreamAddress,proto3" json:"tx_stream_address,omitempty"`             // where the Server listens for audio to be transmitted on the radio
	StateUpdatesAddress string `protobuf:"bytes,4,opt,name=state_updates_address,json=stateUpdatesAddress,proto3" json:"state_updates_address,omitempty"` // where the Server listens for audio to be transmitted on the radio
	Index               int32  `protobuf:"varint,5,opt,name=index,proto3" json:"index,omitempty"`                                                         // static index for displaying several servers consistently in a GUI
	// contains filtered or unexported fields
}

func (*Capabilities) Descriptor deprecated

func (*Capabilities) Descriptor() ([]byte, []int)

Deprecated: Use Capabilities.ProtoReflect.Descriptor instead.

func (*Capabilities) GetIndex

func (x *Capabilities) GetIndex() int32

func (*Capabilities) GetName

func (x *Capabilities) GetName() string

func (*Capabilities) GetRxStreamAddress

func (x *Capabilities) GetRxStreamAddress() string

func (*Capabilities) GetStateUpdatesAddress

func (x *Capabilities) GetStateUpdatesAddress() string

func (*Capabilities) GetTxStreamAddress

func (x *Capabilities) GetTxStreamAddress() string

func (*Capabilities) ProtoMessage

func (*Capabilities) ProtoMessage()

func (*Capabilities) ProtoReflect added in v0.5.0

func (x *Capabilities) ProtoReflect() protoreflect.Message

func (*Capabilities) Reset

func (x *Capabilities) Reset()

func (*Capabilities) String

func (x *Capabilities) String() string

type Channels

type Channels int32
const (
	Channels_unknown Channels = 0
	Channels_mono    Channels = 1
	Channels_stereo  Channels = 2
)

func (Channels) Descriptor added in v0.5.0

func (Channels) Descriptor() protoreflect.EnumDescriptor

func (Channels) Enum added in v0.5.0

func (x Channels) Enum() *Channels

func (Channels) EnumDescriptor deprecated

func (Channels) EnumDescriptor() ([]byte, []int)

Deprecated: Use Channels.Descriptor instead.

func (Channels) Number added in v0.5.0

func (x Channels) Number() protoreflect.EnumNumber

func (Channels) String

func (x Channels) String() string

func (Channels) Type added in v0.5.0

type Codec

type Codec int32
const (
	Codec_none Codec = 0
	Codec_opus Codec = 1
	Codec_pcm  Codec = 2
)

func (Codec) Descriptor added in v0.5.0

func (Codec) Descriptor() protoreflect.EnumDescriptor

func (Codec) Enum added in v0.5.0

func (x Codec) Enum() *Codec

func (Codec) EnumDescriptor deprecated

func (Codec) EnumDescriptor() ([]byte, []int)

Deprecated: Use Codec.Descriptor instead.

func (Codec) Number added in v0.5.0

func (x Codec) Number() protoreflect.EnumNumber

func (Codec) String

func (x Codec) String() string

func (Codec) Type added in v0.5.0

func (Codec) Type() protoreflect.EnumType

type Frame

type Frame struct {
	Codec        Codec    `protobuf:"varint,1,opt,name=codec,proto3,enum=shackbus.audio.Codec" json:"codec,omitempty"`
	Channels     Channels `protobuf:"varint,2,opt,name=channels,proto3,enum=shackbus.audio.Channels" json:"channels,omitempty"` // Number of channels
	FrameLength  int32    `protobuf:"varint,3,opt,name=frame_length,json=frameLength,proto3" json:"frame_length,omitempty"`     // Audio frame length (in bytes)
	SamplingRate int32    `protobuf:"varint,4,opt,name=sampling_rate,json=samplingRate,proto3" json:"sampling_rate,omitempty"`  // Audio sampling rate
	BitDepth     int32    `protobuf:"varint,5,opt,name=bit_depth,json=bitDepth,proto3" json:"bit_depth,omitempty"`              // Audio bit depth (8...16 bit typically)
	Data         []byte   `protobuf:"bytes,6,opt,name=data,proto3" json:"data,omitempty"`                                       // Audio packets as raw byte array
	UserId       string   `protobuf:"bytes,8,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"`
	// contains filtered or unexported fields
}

Audio frame consisting of the raw audio byte array + metadata

func (*Frame) Descriptor deprecated

func (*Frame) Descriptor() ([]byte, []int)

Deprecated: Use Frame.ProtoReflect.Descriptor instead.

func (*Frame) GetBitDepth

func (x *Frame) GetBitDepth() int32

func (*Frame) GetChannels

func (x *Frame) GetChannels() Channels

func (*Frame) GetCodec

func (x *Frame) GetCodec() Codec

func (*Frame) GetData

func (x *Frame) GetData() []byte

func (*Frame) GetFrameLength

func (x *Frame) GetFrameLength() int32

func (*Frame) GetSamplingRate

func (x *Frame) GetSamplingRate() int32

func (*Frame) GetUserId

func (x *Frame) GetUserId() string

func (*Frame) ProtoMessage

func (*Frame) ProtoMessage()

func (*Frame) ProtoReflect added in v0.5.0

func (x *Frame) ProtoReflect() protoreflect.Message

func (*Frame) Reset

func (x *Frame) Reset()

func (*Frame) String

func (x *Frame) String() string

type None

type None struct {
	// contains filtered or unexported fields
}

func (*None) Descriptor deprecated

func (*None) Descriptor() ([]byte, []int)

Deprecated: Use None.ProtoReflect.Descriptor instead.

func (*None) ProtoMessage

func (*None) ProtoMessage()

func (*None) ProtoReflect added in v0.5.0

func (x *None) ProtoReflect() protoreflect.Message

func (*None) Reset

func (x *None) Reset()

func (*None) String

func (x *None) String() string

type PingPong

type PingPong struct {
	Ping int64 `protobuf:"varint,1,opt,name=ping,proto3" json:"ping,omitempty"` // unix timestamp
	// contains filtered or unexported fields
}

func (*PingPong) Descriptor deprecated

func (*PingPong) Descriptor() ([]byte, []int)

Deprecated: Use PingPong.ProtoReflect.Descriptor instead.

func (*PingPong) GetPing

func (x *PingPong) GetPing() int64

func (*PingPong) ProtoMessage

func (*PingPong) ProtoMessage()

func (*PingPong) ProtoReflect added in v0.5.0

func (x *PingPong) ProtoReflect() protoreflect.Message

func (*PingPong) Reset

func (x *PingPong) Reset()

func (*PingPong) String

func (x *PingPong) String() string

type ServerHandler

type ServerHandler interface {
	GetCapabilities(context.Context, *None, *Capabilities) error
	GetState(context.Context, *None, *State) error
	StartStream(context.Context, *None, *None) error
	StopStream(context.Context, *None, *None) error
	Ping(context.Context, *PingPong, *PingPong) error
}

type ServerService

type ServerService interface {
	GetCapabilities(ctx context.Context, in *None, opts ...client.CallOption) (*Capabilities, error)
	GetState(ctx context.Context, in *None, opts ...client.CallOption) (*State, error)
	StartStream(ctx context.Context, in *None, opts ...client.CallOption) (*None, error)
	StopStream(ctx context.Context, in *None, opts ...client.CallOption) (*None, error)
	Ping(ctx context.Context, in *PingPong, opts ...client.CallOption) (*PingPong, error)
}

func NewServerService

func NewServerService(name string, c client.Client) ServerService

type State

type State struct {
	RxOn   bool   `protobuf:"varint,1,opt,name=rx_on,json=rxOn,proto3" json:"rx_on,omitempty"`
	TxUser string `protobuf:"bytes,3,opt,name=tx_user,json=txUser,proto3" json:"tx_user,omitempty"`
	// contains filtered or unexported fields
}

func (*State) Descriptor deprecated

func (*State) Descriptor() ([]byte, []int)

Deprecated: Use State.ProtoReflect.Descriptor instead.

func (*State) GetRxOn

func (x *State) GetRxOn() bool

func (*State) GetTxUser

func (x *State) GetTxUser() string

func (*State) ProtoMessage

func (*State) ProtoMessage()

func (*State) ProtoReflect added in v0.5.0

func (x *State) ProtoReflect() protoreflect.Message

func (*State) Reset

func (x *State) Reset()

func (*State) String

func (x *State) String() string

Jump to

Keyboard shortcuts

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