client

package
v0.0.0-...-7233789 Latest Latest
Warning

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

Go to latest
Published: Jul 25, 2019 License: MIT Imports: 11 Imported by: 0

Documentation

Overview

player for KiwiSDF Audio.

Index

Constants

This section is empty.

Variables

View Source
var AM = Mode{"am", -4900, 4900, 0}
View Source
var AM_3500 = Mode{"am", -3500, 3500, 0}
View Source
var AM_NARROW = Mode{"am", -2500, 2500, 0}
View Source
var CW = Mode{"cw", 300, 700, -500}
View Source
var CW_3500 = Mode{"cw", 200, 3500, -500}
View Source
var CW_NARROW = Mode{"cw", 470, 530, -500}
View Source
var LSB = Mode{"lsb", -2700, -300, 0}
View Source
var LSB_3500 = Mode{"lsb", -3500, -200, 0}
View Source
var LSB_NARROW = Mode{"lsb", -2200, -300, 0}
View Source
var NONE = Mode{"", 0, 0, 0}

Common Modes

View Source
var USB = Mode{"usb", 300, 2700, 0}
View Source
var USB_3500 = Mode{"usb", 200, 3500, 0}
View Source
var USB_NARROW = Mode{"usb", 300, 2200, 0}

Functions

func GetClientNum

func GetClientNum() int64

Types

type AudioClient

type AudioClient struct {
	Client *Client
}

func NewAudioClient

func NewAudioClient(client *Client) *AudioClient

func (*AudioClient) BackgroundPlayForDuration

func (ac *AudioClient) BackgroundPlayForDuration(d time.Duration) <-chan AudioPacket

func (*AudioClient) ExtractAudioFromMessage

func (ac *AudioClient) ExtractAudioFromMessage(msg Message) AudioPacket

type AudioPacket

type AudioPacket struct {
	Flag     byte
	Sequence int32
	SMeter   uint16
	Samples  []int16
}

type Client

type Client struct {
	*Config
	*Tuning
	ClientNum int64
	Info      map[string]string
	Messages  <-chan Message
	// contains filtered or unexported fields
}

func Dial

func Dial(cf *Config, tun *Tuning) *Client

func (*Client) HangUp

func (c *Client) HangUp()

func (*Client) Send

func (c *Client) Send(s string) error

Send the command string s to the KiwiSDR server.

func (*Client) Sendf

func (c *Client) Sendf(format string, args ...interface{}) error

Send the command string, formatted with args, to the KiwiSDR server.

type Config

type Config struct {
	ServerHost  string
	Password    string
	Kind        Kind
	Identify    string
	Compress    bool
	NoWaterfall bool
	AGC         bool
	ManGain     int
}

type ImaAdpcmDecoder

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

func (*ImaAdpcmDecoder) Decode

func (dec *ImaAdpcmDecoder) Decode(data []byte, skip int) []int16

type Kind

type Kind int
const (
	SND Kind // Sound connection.
	W_F      // Waterfall connection.
)

type Message

type Message struct {
	Tag     string
	Payload []byte
	Err     error
}

type Mode

type Mode struct {
	ModeName string // "am" "cw" "lsb" "usb" "nbfm" "iq"
	LowCut   int    // Hz
	HighCut  int    // Hz
	Offset   int    // Hz
}

type Tuning

type Tuning struct {
	Freq int64 // Hz
	Mode
}

Jump to

Keyboard shortcuts

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