Platform audio controller that manages sinks and microphone capture. More...
Public Types | |
| enum class | match_field_e { device_id , device_friendly_name , adapter_friendly_name , device_description } |
| Enumerates supported match field options. More... | |
| using | match_fields_list_t = std::vector<std::pair<match_field_e, std::wstring>> |
| List of format fields used to compare audio formats. | |
| using | matched_field_t = std::pair<match_field_e, std::wstring> |
| One matched audio-format field and its expected value. | |
Public Member Functions | |
| std::optional< std::pair< std::wstring, std::reference_wrapper< const format_t > > > | extract_virtual_sink_info (const std::string &sink) |
| Extract virtual audio sink information possibly encoded in the sink name. | |
| std::optional< matched_field_t > | find_device_id (const match_fields_list_t &match_list) |
| Search for currently present audio device_id using multiple match fields. | |
| device_t | get_sink_device (const std::string &sink) |
| Resolve a sink name to the audio endpoint device it refers to. | |
| template<typename CreateInstance = decltype(&CoCreateInstance)> | |
| int | init (const CreateInstance &create_instance=&CoCreateInstance) |
| Initialize endpoint enumeration and policy control when routing is managed by Sunshine. | |
| bool | install_steam_audio_drivers () |
| Installs the Steam Streaming Speakers driver, if present. | |
| bool | is_sink_available (const std::string &sink) override |
| Check if the audio sink is available in the system. | |
| audio_control_t::match_fields_list_t | match_all_fields (const std::wstring &name) |
| Build matching fields that all contain the same endpoint name. | |
| audio_control_t::match_fields_list_t | match_steam_speakers () |
| Build matching fields for Steam Streaming Speakers. | |
| std::unique_ptr< mic_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) override |
| Create a microphone capture stream for the requested layout. | |
| void | reset_default_device () |
| Resets the default audio device from Steam Streaming Speakers. | |
| std::optional< std::wstring > | set_format (const std::string &sink) |
| int | set_sink (const std::string &sink) override |
| Update the sink value on the backend. | |
| std::optional< sink_t > | sink_info () override |
| Query host and virtual sink names available to Sunshine. | |
| ~audio_control_t () override=default | |
| Destroy the Windows audio control. | |
Public Attributes | |
| std::string | assigned_sink |
| Sink assigned while Sunshine captures host audio, captured directly by the microphone. | |
| 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.
|
strong |
|
overridevirtualdefault |
Destroy the Windows audio control.
Reimplemented from platf::audio_control_t.
|
inline |
Extract virtual audio sink information possibly encoded in the sink name.
| sink | The sink name |
|
inline |
Search for currently present audio device_id using multiple match fields.
| match_list | Pairs of match fields and values |
|
inline |
Resolve a sink name to the audio endpoint device it refers to.
| sink | Sink name, virtual sink descriptor, or device identifier. |
|
inline |
Initialize endpoint enumeration and policy control when routing is managed by Sunshine.
| CreateInstance | Callable type used for COM activation. |
| create_instance | COM factory used to initialize the required interfaces. |
|
inline |
Installs the Steam Streaming Speakers driver, if present.
|
inlineoverridevirtual |
Check if the audio sink is available in the system.
| sink | Sink to be checked. |
Implements platf::audio_control_t.
|
inline |
Build matching fields that all contain the same endpoint name.
| name | Endpoint name or identifier to match across all fields. |
|
inline |
Build matching fields for Steam Streaming Speakers.
|
inlineoverridevirtual |
Create a microphone capture stream for the requested layout.
| 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. |
Implements platf::audio_control_t.
|
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
| sink | Audio sink name to route or capture. |
|
inlineoverridevirtual |
Update the sink value on the backend.
| sink | Audio sink name to route or capture. |
Implements platf::audio_control_t.
|
inlineoverridevirtual |
Query host and virtual sink names available to Sunshine.
Implements platf::audio_control_t.