io_api

package
v0.10.35 Latest Latest
Warning

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

Go to latest
Published: May 7, 2021 License: Unlicense Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Capture

func Capture(ctx context.Context, w io.Writer, config StreamConfig) error

Capture records incoming samples into the provided writer. The function initializes a capture device in the default context using provide stream configuration. Capturing will commence writing the samples to the writer until either the writer returns an error, or the context signals done.

func Playback

func Playback(ctx context.Context, r io.Reader, config StreamConfig) error

Playback streams samples from a reader to the sound device. The function initializes a playback device in the default context using provide stream configuration. Playback will commence playing the samples provided from the reader until either the reader returns an error, or the context signals done.

Types

type StreamConfig

type StreamConfig struct {
	Format     malgo.FormatType
	Channels   int
	SampleRate int
}

StreamConfig describes the parameters for an audio stream. Default values will pick the defaults of the default device.

Jump to

Keyboard shortcuts

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