feat(audio): add an option to disable sound streaming (#3833)
This commit is contained in:
parent
7b6818ab4a
commit
8ef838bada
6 changed files with 40 additions and 0 deletions
|
|
@ -770,6 +770,29 @@ editing the `conf` file in a text editor. Use the examples as reference.
|
|||
</tr>
|
||||
</table>
|
||||
|
||||
### stream_audio
|
||||
|
||||
<table>
|
||||
<tr>
|
||||
<td>Description</td>
|
||||
<td colspan="2">
|
||||
Whether to stream audio or not. Disabling this can be useful for streaming headless displays as second monitors.
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Default</td>
|
||||
<td colspan="2">@code{}
|
||||
enabled
|
||||
@endcode</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Example</td>
|
||||
<td colspan="2">@code{}
|
||||
stream_audio = disabled
|
||||
@endcode</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
### install_steam_audio_drivers
|
||||
|
||||
<table>
|
||||
|
|
|
|||
|
|
@ -129,6 +129,10 @@ namespace audio {
|
|||
|
||||
void capture(safe::mail_t mail, config_t config, void *channel_data) {
|
||||
auto shutdown_event = mail->event<bool>(mail::shutdown);
|
||||
if (!config::audio.stream) {
|
||||
shutdown_event->view();
|
||||
return;
|
||||
}
|
||||
auto stream = stream_configs[map_stream(config.channels, config.flags[config_t::HIGH_QUALITY])];
|
||||
if (config.flags[config_t::CUSTOM_SURROUND_PARAMS]) {
|
||||
apply_surround_params(stream, config.customStreamParams);
|
||||
|
|
|
|||
|
|
@ -511,6 +511,7 @@ namespace config {
|
|||
audio_t audio {
|
||||
{}, // audio_sink
|
||||
{}, // virtual_sink
|
||||
true, // stream audio
|
||||
true, // install_steam_drivers
|
||||
};
|
||||
|
||||
|
|
@ -1160,6 +1161,7 @@ namespace config {
|
|||
|
||||
string_f(vars, "audio_sink", audio.sink);
|
||||
string_f(vars, "virtual_sink", audio.virtual_sink);
|
||||
bool_f(vars, "stream_audio", audio.stream);
|
||||
bool_f(vars, "install_steam_audio_drivers", audio.install_steam_drivers);
|
||||
|
||||
string_restricted_f(vars, "origin_web_ui_allowed", nvhttp.origin_web_ui_allowed, {"pc"sv, "lan"sv, "wan"sv});
|
||||
|
|
|
|||
|
|
@ -147,6 +147,7 @@ namespace config {
|
|||
struct audio_t {
|
||||
std::string sink;
|
||||
std::string virtual_sink;
|
||||
bool stream;
|
||||
bool install_steam_drivers;
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -63,6 +63,14 @@ const config = ref(props.config)
|
|||
</template>
|
||||
</PlatformLayout>
|
||||
|
||||
<!-- Disable Audio -->
|
||||
<Checkbox class="mb-3"
|
||||
id="stream_audio"
|
||||
locale-prefix="config"
|
||||
v-model="config.stream_audio"
|
||||
default="true"
|
||||
></Checkbox>
|
||||
|
||||
<AdapterNameSelector
|
||||
:platform="platform"
|
||||
:config="config"
|
||||
|
|
|
|||
|
|
@ -329,6 +329,8 @@
|
|||
"qsv_slow_hevc": "Allow Slow HEVC Encoding",
|
||||
"qsv_slow_hevc_desc": "This can enable HEVC encoding on older Intel GPUs, at the cost of higher GPU usage and worse performance.",
|
||||
"restart_note": "Sunshine is restarting to apply changes.",
|
||||
"stream_audio": "Stream Audio",
|
||||
"stream_audio_desc": "Whether to stream audio or not. Disabling this can be useful for streaming headless displays as second monitors.",
|
||||
"sunshine_name": "Sunshine Name",
|
||||
"sunshine_name_desc": "The name displayed by Moonlight. If not specified, the PC's hostname is used",
|
||||
"sw_preset": "SW Presets",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue