connector

package
v0.0.0-...-987958a Latest Latest
Warning

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

Go to latest
Published: Oct 23, 2021 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

* Connector for emulator, by default, this connector will output a sin wave *

* Connector for *

* Connector for serial port *

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Connector

type Connector interface {
	Open() error
	Close()
	ReadBytes() ([]byte, error)
	GetBufferChannel() chan []float32
	Name() string
}

type Emulator

type Emulator struct {
	Connector
	// contains filtered or unexported fields
}

func NewEmulator

func NewEmulator(ctxf context.Context) *Emulator

func (*Emulator) Close

func (em *Emulator) Close()

func (*Emulator) GetBufferChannel

func (em *Emulator) GetBufferChannel() chan []float32

func (*Emulator) Name

func (em *Emulator) Name() string

func (*Emulator) Open

func (em *Emulator) Open() error

func (*Emulator) ReadBytes

func (em *Emulator) ReadBytes() ([]byte, error)

type PortAudio

type PortAudio struct {
	Connector

	*portaudio.Stream
	// contains filtered or unexported fields
}

func NewPortAudio

func NewPortAudio(ctx context.Context) *PortAudio

func (*PortAudio) Close

func (al *PortAudio) Close()

func (*PortAudio) GetBufferChannel

func (al *PortAudio) GetBufferChannel() chan []float32

func (*PortAudio) GetOutPutBufferChannel

func (al *PortAudio) GetOutPutBufferChannel() chan []float32

func (*PortAudio) Info

func (al *PortAudio) Info()

func (*PortAudio) Name

func (al *PortAudio) Name() string

func (*PortAudio) Open

func (al *PortAudio) Open() error

func (*PortAudio) ReadBytes

func (al *PortAudio) ReadBytes() ([]byte, error)

type Serial

type Serial struct {
	Connector
	// contains filtered or unexported fields
}

func NewSerial

func NewSerial(ctxf context.Context, portName string, baudRate int) *Serial

func (*Serial) Close

func (se *Serial) Close()

func (*Serial) GetBufferChannel

func (se *Serial) GetBufferChannel() chan []float32

func (*Serial) Name

func (se *Serial) Name() string

func (*Serial) Open

func (se *Serial) Open() error

func (*Serial) ReadBytes

func (se *Serial) ReadBytes() ([]byte, error)

func (*Serial) SetWashCallback

func (se *Serial) SetWashCallback(cb func([]byte) []float32)

Jump to

Keyboard shortcuts

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