audionode

package
v0.0.0-...-683b059 Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2022 License: BSD-3-Clause Imports: 5 Imported by: 0

Documentation

Overview

Package audionode provides the control of audionode settings from cras.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ActiveCrasNode

func ActiveCrasNode(ctx context.Context, cras *audio.Cras) (*audio.CrasNode, error)

ActiveCrasNode returns the active output node.

func SetAudioNode

func SetAudioNode(ctx context.Context, audioNode string) (string, error)

SetAudioNode sets the expected audio node for audio routing.

Types

type Helper

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

Helper helps to set/get system volume and provides volume related functions.

func NewVolumeHelper

func NewVolumeHelper(ctx context.Context) (*Helper, error)

NewVolumeHelper returns a new volume Helper instance.

func (*Helper) ActiveNodeVolume

func (vh *Helper) ActiveNodeVolume(ctx context.Context) (int, error)

ActiveNodeVolume returns the current volume of active node.

func (*Helper) SetVolume

func (vh *Helper) SetVolume(ctx context.Context, volume int) error

SetVolume sets the volume to the given value.

func (*Helper) VerifyVolumeChanged

func (vh *Helper) VerifyVolumeChanged(ctx context.Context, doChange func() error) error

VerifyVolumeChanged verifies volume is changed before and after calling doChange().

Jump to

Keyboard shortcuts

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