sound

package
v0.0.0-...-27bf058 Latest Latest
Warning

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

Go to latest
Published: Jan 3, 2024 License: GPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	OSReleaseFile = "/etc/os-release"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type AlsaSound

type AlsaSound struct{}

AlsaSound implements SoundSystem using alsa-utils

func NewAlsaSound

func NewAlsaSound() *AlsaSound

func (*AlsaSound) PlayWAV

func (as *AlsaSound) PlayWAV(ctx context.Context, filePath string) error

func (*AlsaSound) RecordToFile

func (as *AlsaSound) RecordToFile(ctx context.Context, filePath string) error

type SoundSystem

type SoundSystem interface {
	// RecordToFile takes the given filepath, creates the file and write WAV comtabile audio to it, until context is cancelled
	RecordToFile(ctx context.Context, filePath string) error
	// PlayWAV playes the given file until context is canceled
	PlayWAV(ctx context.Context, filePath string) error
}

SoundSystem represents a way to play/record sound on a raspberry pi

Jump to

Keyboard shortcuts

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