Documentation ¶
Index ¶
- Variables
- type Device
- func (d *Device) Cleanup() error
- func (d *Device) DeviceName() (string, error)
- func (d *Device) GetVolumeLevel() (float32, error)
- func (d *Device) RefreshAudioSessions() error
- func (d *Device) SetAudioSessionVolumeLevel(sessionName string, v float32) error
- func (d *Device) SetVolumeLevel(v float32) error
Constants ¶
This section is empty.
Variables ¶
Functions ¶
This section is empty.
Types ¶
type Device ¶
func New ¶
New takes in a *wca.IMMDevice and wraps it as a *Device with some nice helper methods to do common tasks like SetVolumeLevel, GetVolumeLevel, etc.
func (*Device) Cleanup ¶
Cleanup will release and remove any pointers or leftover devices from the creation process.
func (*Device) DeviceName ¶
DeviceName returns the name of the audio device if it exists.
func (*Device) GetVolumeLevel ¶
GetVolumeLevel will get the volume of the device, if it exists, as a float on the scale of 0-1.
func (*Device) RefreshAudioSessions ¶
RefreshAudioSessions will attempt to repopulate all of the stored audio session information for use with the SetAudioSessionVolume, GetAudioSessionVolume, etc.
func (*Device) SetAudioSessionVolumeLevel ¶
SetAudioSessionVolumeLevel takes the sessionName which is the string to match on the ProcessExecutable of the sessions and a float between 0-1 to set the volume of any matching sessions.
func (*Device) SetVolumeLevel ¶
SetVolumeLevel takes a float between 0-1 and it will set the volume of the device to that value.