Skip to content
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions docs/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down
4 changes: 4 additions & 0 deletions src/audio.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 2 additions & 0 deletions src/config.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -511,6 +511,7 @@ namespace config {
audio_t audio {
{}, // audio_sink
{}, // virtual_sink
true, // stream audio
true, // install_steam_drivers
};

Expand Down Expand Up @@ -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});
Expand Down
1 change: 1 addition & 0 deletions src/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,7 @@ namespace config {
struct audio_t {
std::string sink;
std::string virtual_sink;
bool stream;
bool install_steam_drivers;
};

Expand Down
8 changes: 8 additions & 0 deletions src_assets/common/assets/web/configs/tabs/AudioVideo.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 2 additions & 0 deletions src_assets/common/assets/web/public/assets/locale/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
Loading