microphone

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Dec 5, 2023 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Initialize

func Initialize()

Initialize inits the library

func Teardown

func Teardown()

Teardown cleans up the library

Types

type AudioConfig

type AudioConfig struct {
	InputChannels int
	SamplingRate  float32
}

AudioConfig init config for library

type Microphone

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

Microphone...

func New

func New(cfg AudioConfig) (*Microphone, error)

New creates a new microphone using portaudio

func (*Microphone) Mute

func (m *Microphone) Mute()

Mute silences the mic

func (*Microphone) Read

func (m *Microphone) Read() ([]int16, error)

Read gets the raw bits generated by the mic

func (*Microphone) Start

func (m *Microphone) Start() error

Start begins the listening on the microphone

func (*Microphone) Stop

func (m *Microphone) Stop() error

Stop terminates listening on the mic

func (*Microphone) Stream

func (m *Microphone) Stream(w io.Writer) error

Stream is a helper function to stream the mic data to a source

func (*Microphone) Unmute

func (m *Microphone) Unmute()

Unmute restores recording on the mic

Jump to

Keyboard shortcuts

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