Platform audio controller that manages sinks and microphone capture.
More...
|
|
std::string | assigned_sink |
| | Virtual sink assigned while Sunshine captures host audio.
|
| |
|
audio::device_enum_t | device_enum |
| | Device enumerator used to query and watch audio endpoints.
|
| |
|
policy_t | policy |
| | Windows policy configuration interface used to switch default audio devices.
|
| |
Platform audio controller that manages sinks and microphone capture.
◆ match_field_e
Enumerates supported match field options.
| Enumerator |
|---|
| device_id | Match device_id.
|
| device_friendly_name | Match endpoint friendly name.
|
| adapter_friendly_name | Match adapter friendly name.
|
| device_description | Match endpoint description.
|
◆ ~audio_control_t()
| platf::audio::audio_control_t::~audio_control_t |
( |
| ) |
|
|
inlineoverridevirtual |
◆ extract_virtual_sink_info()
| std::optional< std::pair< std::wstring, std::reference_wrapper< const format_t > > > platf::audio::audio_control_t::extract_virtual_sink_info |
( |
const std::string & | sink | ) |
|
|
inline |
Extract virtual audio sink information possibly encoded in the sink name.
- Parameters
-
- Returns
- A pair of device_id and format reference if the sink name matches our naming scheme for virtual audio sinks,
std::nullopt otherwise.
◆ find_device_id()
Search for currently present audio device_id using multiple match fields.
- Parameters
-
| match_list | Pairs of match fields and values |
- Returns
- Optional pair of matched field and device_id
◆ init()
| int platf::audio::audio_control_t::init |
( |
| ) |
|
|
inline |
Initialize Windows audio policy interfaces.
- Returns
- 0 on success; nonzero or negative platform status on failure.
◆ install_steam_audio_drivers()
| bool platf::audio::audio_control_t::install_steam_audio_drivers |
( |
| ) |
|
|
inline |
Installs the Steam Streaming Speakers driver, if present.
- Returns
true if installation was successful.
◆ is_sink_available()
| bool platf::audio::audio_control_t::is_sink_available |
( |
const std::string & | sink | ) |
|
|
inlineoverridevirtual |
Check if the audio sink is available in the system.
- Parameters
-
- Returns
- True if available, false otherwise.
Implements platf::audio_control_t.
◆ match_all_fields()
Build matching fields that all contain the same endpoint name.
- Parameters
-
| name | Endpoint name or identifier to match across all fields. |
- Returns
- Field list requiring every supported endpoint field to match the name.
◆ match_steam_speakers()
Build matching fields for Steam Streaming Speakers.
- Returns
- Field list used to identify Steam's virtual speaker endpoint.
◆ microphone()
| std::unique_ptr< mic_t > platf::audio::audio_control_t::microphone |
( |
const std::uint8_t * | mapping, |
|
|
int | channels, |
|
|
std::uint32_t | sample_rate, |
|
|
std::uint32_t | frame_size, |
|
|
bool | continuous_audio, |
|
|
bool | host_audio_enabled ) |
|
inlineoverridevirtual |
Create a microphone capture stream for the requested layout.
- Parameters
-
| mapping | Opus channel mapping table for the requested layout. |
| channels | Number of audio channels in the stream. |
| sample_rate | Audio sample rate in hertz. |
| frame_size | Number of samples captured per audio frame. |
| continuous_audio | Continuous audio. |
| host_audio_enabled | Whether host playback should remain enabled during capture. |
- Returns
- Microphone capture object for the requested audio layout.
Implements platf::audio_control_t.
◆ set_format()
| std::optional< std::wstring > platf::audio::audio_control_t::set_format |
( |
const std::string & | sink | ) |
|
|
inline |
If the requested sink is a virtual sink, meaning no speakers attached to the host, then we can seamlessly set the format to stereo and surround sound.
Any virtual sink detected will be prefixed by: virtual-(format name) If it doesn't contain that prefix, then the format will not be changed
- Parameters
-
| sink | Audio sink name to route or capture. |
- Returns
- Status from updating format.
◆ set_sink()
| int platf::audio::audio_control_t::set_sink |
( |
const std::string & | sink | ) |
|
|
inlineoverridevirtual |
Update the sink value on the backend.
- Parameters
-
| sink | Audio sink name to route or capture. |
- Returns
- Status from updating sink.
Implements platf::audio_control_t.
◆ sink_info()
| std::optional< sink_t > platf::audio::audio_control_t::sink_info |
( |
| ) |
|
|
inlineoverridevirtual |
Query host and virtual sink names available to Sunshine.
- Returns
- Host and virtual sink names when the backend can report them.
Implements platf::audio_control_t.
The documentation for this class was generated from the following file: