From ac0417e26f9b48e69b05f726c1694b246ee4df46 Mon Sep 17 00:00:00 2001 From: gaxeer Date: Fri, 17 Jan 2025 18:53:26 +0200 Subject: [PATCH 01/19] add announcement tts effect, sync pre sfx, tts and post sfx --- code/__HELPERS/priority_announce.dm | 3 +-- modular_bandastation/tts/code/shell.dm | 26 ++++++++++++++++++- .../tts/code/tts_subsystem.dm | 9 +++++-- 3 files changed, 33 insertions(+), 5 deletions(-) diff --git a/code/__HELPERS/priority_announce.dm b/code/__HELPERS/priority_announce.dm index 84148d603edae..f8d85e3545224 100644 --- a/code/__HELPERS/priority_announce.dm +++ b/code/__HELPERS/priority_announce.dm @@ -207,7 +207,6 @@ // SEND_SOUND(target, sound(sound_to_play)) // Bandastion Removal /// SS220 TTS START var/datum/tts_seed/announcement_tts_seed = tts_override?.tts_seed - var/list/tts_effects = tts_override?.get_effects() if(isnull(announcement_tts_seed)) var/mob/living/silicon/ai/active_ai = DEFAULTPICK(active_ais(TRUE, null), null) announcement_tts_seed = active_ai ? active_ai.get_tts_seed() : /datum/tts_seed/silero/glados @@ -220,7 +219,7 @@ announcement, \ announcement_tts_seed, \ FALSE, \ - tts_effects, \ + list(/datum/singleton/sound_effect/announcement), \ null, \ sound_to_play \ ) diff --git a/modular_bandastation/tts/code/shell.dm b/modular_bandastation/tts/code/shell.dm index d97c99f5707fb..591f7a339c084 100644 --- a/modular_bandastation/tts/code/shell.dm +++ b/modular_bandastation/tts/code/shell.dm @@ -11,11 +11,19 @@ CRASH("Invalid sound effect chosen.") var/list/ffmpeg_arguments = list() + var/complex = FALSE for(var/datum/singleton/sound_effect/effect as anything in effects) + if(effect.complex) + ffmpeg_arguments = list(effect.ffmpeg_arguments) + complex = TRUE + break + ffmpeg_arguments |= effect.ffmpeg_arguments var/taskset = CONFIG_GET(string/ffmpeg_cpuaffinity) ? "taskset -ac [CONFIG_GET(string/ffmpeg_cpuaffinity)]" : "" - var/command = {"[taskset] ffmpeg -y -hide_banner -loglevel error -i [filename_input] -filter:a "[ffmpeg_arguments.Join(", ")]" [filename_output]"} + var/filter_part = complex ? ffmpeg_arguments.Join() : {"-filter:a "[ffmpeg_arguments.Join(", ")]""} + + var/command = {"[taskset] ffmpeg -y -hide_banner -loglevel error -i [filename_input] [filter_part] [filename_output]"} var/list/output = world.shelleo(command) var/errorlevel = output[SHELLEO_ERRORLEVEL] @@ -30,8 +38,10 @@ return TRUE /datum/singleton/sound_effect + var/complex = FALSE var/suffix var/ffmpeg_arguments + /// If set to TRUE, this effect will ignore all other filters. /datum/singleton/sound_effect/radio suffix = "_radio" @@ -45,6 +55,20 @@ suffix = "_megaphone" ffmpeg_arguments = "highpass=f=500, lowpass=f=4000, volume=volume=10, acrusher=1:1:45:0:log" +/datum/singleton/sound_effect/announcement + complex = TRUE + suffix = "_announcement" + ffmpeg_arguments = {"\ + -i ./tools/tts/tts-api/RoomImpulse.wav -filter_complex \ + "\[1:a\]volume=5\[impulse\]; \ + \[0:a\]\[impulse\]afir=dry=10:wet=10\[reverb\]; \ + \[0:a\]\[reverb\]amix=inputs=2:weights=8 1\[mixed\]; \ + \[mixed\]highpass=f=200,lowpass=f=14000\[filtered\]; \ + \[filtered\]deesser=i=0.4\[deessed\]; \ + \[deessed\]acrusher=mix=0.1:mode=lin:aa=1:samples=250\[crushed\]; \ + \[crushed\]equalizer=f=4000:t=h:width=2000:g=8"\ + "} + #undef SHELLEO_ERRORLEVEL #undef SHELLEO_STDOUT #undef SHELLEO_STDERR diff --git a/modular_bandastation/tts/code/tts_subsystem.dm b/modular_bandastation/tts/code/tts_subsystem.dm index 641a88eb51817..db9fd1563644f 100644 --- a/modular_bandastation/tts/code/tts_subsystem.dm +++ b/modular_bandastation/tts/code/tts_subsystem.dm @@ -364,6 +364,10 @@ SUBSYSTEM_DEF(tts220) var/list/filename_suffixes = list() for(var/datum/singleton/sound_effect/effect as anything in effects) + if(effect.complex) + filename_suffixes = list(effect.suffix) + break + filename_suffixes |= effect.suffix sortTim(filename_suffixes, GLOBAL_PROC_REF(cmp_text_asc)) @@ -429,14 +433,15 @@ SUBSYSTEM_DEF(tts220) /datum/controller/subsystem/tts220/proc/play_sfx_if_exists(mob/listener, sfx, sound/output) if(sfx) - play_sfx(listener, sfx, output.volume, output.environment) + play_sfx(listener, sfx, output.volume, output.environment, output.channel) -/datum/controller/subsystem/tts220/proc/play_sfx(mob/listener, sfx, volume, environment) +/datum/controller/subsystem/tts220/proc/play_sfx(mob/listener, sfx, volume, environment, channel) var/sound/output = sound(sfx) output.status = SOUND_STREAM output.wait = TRUE output.volume = volume output.environment = environment + output.channel = channel SEND_SOUND(listener, output) /datum/controller/subsystem/tts220/proc/get_local_channel_by_owner(owner) From 07d1e34387a22f759b3e42854d3c2a6e119bba0e Mon Sep 17 00:00:00 2001 From: gaxeer Date: Fri, 17 Jan 2025 19:13:46 +0200 Subject: [PATCH 02/19] update effect --- modular_bandastation/tts/code/shell.dm | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/modular_bandastation/tts/code/shell.dm b/modular_bandastation/tts/code/shell.dm index 591f7a339c084..0833a49f61815 100644 --- a/modular_bandastation/tts/code/shell.dm +++ b/modular_bandastation/tts/code/shell.dm @@ -60,13 +60,11 @@ suffix = "_announcement" ffmpeg_arguments = {"\ -i ./tools/tts/tts-api/RoomImpulse.wav -filter_complex \ - "\[1:a\]volume=5\[impulse\]; \ - \[0:a\]\[impulse\]afir=dry=10:wet=10\[reverb\]; \ - \[0:a\]\[reverb\]amix=inputs=2:weights=8 1\[mixed\]; \ - \[mixed\]highpass=f=200,lowpass=f=14000\[filtered\]; \ - \[filtered\]deesser=i=0.4\[deessed\]; \ - \[deessed\]acrusher=mix=0.1:mode=lin:aa=1:samples=250\[crushed\]; \ - \[crushed\]equalizer=f=4000:t=h:width=2000:g=8"\ + "[0:a]apad=pad_dur=2[input_padded]; [1:a]apad=whole_len=10000[impulse_padded]; \ + [impulse_padded]volume=5[impulse]; [input_padded][impulse]afir=dry=10:wet=10[reverb]; \ + [0:a][reverb]amix=inputs=2:weights=8 1[mixed]; [mixed]highpass=f=200,lowpass=f=14000[filtered]; \ + [filtered]deesser=i=0.4[deessed]; [deessed]acrusher=mix=0.1:mode=lin:aa=1:samples=250[crushed]; \ + [crushed]equalizer=f=4000:t=h:width=2000:g=8"\ "} #undef SHELLEO_ERRORLEVEL From 69f1fe0ff125f206cc39baee969bfbf83712e031 Mon Sep 17 00:00:00 2001 From: gaxeer Date: Fri, 17 Jan 2025 19:26:04 +0200 Subject: [PATCH 03/19] fix filter, trim tts message instead of not ttsing it at all --- modular_bandastation/tts/code/shell.dm | 10 +++++----- modular_bandastation/tts/code/tts_subsystem.dm | 6 ++++-- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/modular_bandastation/tts/code/shell.dm b/modular_bandastation/tts/code/shell.dm index 0833a49f61815..67bd5a8c9a035 100644 --- a/modular_bandastation/tts/code/shell.dm +++ b/modular_bandastation/tts/code/shell.dm @@ -60,11 +60,11 @@ suffix = "_announcement" ffmpeg_arguments = {"\ -i ./tools/tts/tts-api/RoomImpulse.wav -filter_complex \ - "[0:a]apad=pad_dur=2[input_padded]; [1:a]apad=whole_len=10000[impulse_padded]; \ - [impulse_padded]volume=5[impulse]; [input_padded][impulse]afir=dry=10:wet=10[reverb]; \ - [0:a][reverb]amix=inputs=2:weights=8 1[mixed]; [mixed]highpass=f=200,lowpass=f=14000[filtered]; \ - [filtered]deesser=i=0.4[deessed]; [deessed]acrusher=mix=0.1:mode=lin:aa=1:samples=250[crushed]; \ - [crushed]equalizer=f=4000:t=h:width=2000:g=8"\ + "\[0:a\]apad=pad_dur=2\[input_padded\]; \[1:a\]apad=whole_len=10000\[impulse_padded\]; \ + \[impulse_padded\]volume=5\[impulse\]; \[input_padded\]\[impulse\]afir=dry=10:wet=10\[reverb\]; \ + \[0:a\]\[reverb\]amix=inputs=2:weights=8 1\[mixed\]; \[mixed\]highpass=f=200,lowpass=f=14000\[filtered\]; \ + \[filtered\]deesser=i=0.4\[deessed\]; \[deessed\]acrusher=mix=0.1:mode=lin:aa=1:samples=250\[crushed\]; \ + \[crushed\]equalizer=f=4000:t=h:width=2000:g=8"\ "} #undef SHELLEO_ERRORLEVEL diff --git a/modular_bandastation/tts/code/tts_subsystem.dm b/modular_bandastation/tts/code/tts_subsystem.dm index db9fd1563644f..7a9bf6fe58a12 100644 --- a/modular_bandastation/tts/code/tts_subsystem.dm +++ b/modular_bandastation/tts/code/tts_subsystem.dm @@ -262,9 +262,11 @@ SUBSYSTEM_DEF(tts220) var/dirty_text = message var/text = sanitize_tts_input(dirty_text) - if(!text || length_char(text) > MAX_MESSAGE_LEN) + if(!text) return + text = trim(text, MAX_MESSAGE_LEN) + if(traits & TTS_TRAIT_RATE_FASTER) text = provider.rate_faster(text) @@ -276,7 +278,7 @@ SUBSYSTEM_DEF(tts220) var/hash = md5(lowertext(text)) - var/filename = "data/tts_cache/[tts_seed.name]/[hash]" + var/filename = "input" var/list/effect_singletons = list() for(var/effect_type in effect_types) effect_singletons += GET_SINGLETON_TYPE_LIST(effect_type) From fc0df548409832fa6a1cb8a27b5ebdd916648f0c Mon Sep 17 00:00:00 2001 From: gaxeer Date: Fri, 17 Jan 2025 19:29:00 +0200 Subject: [PATCH 04/19] update efect --- modular_bandastation/tts/code/shell.dm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modular_bandastation/tts/code/shell.dm b/modular_bandastation/tts/code/shell.dm index 67bd5a8c9a035..fddd0e2549461 100644 --- a/modular_bandastation/tts/code/shell.dm +++ b/modular_bandastation/tts/code/shell.dm @@ -63,7 +63,7 @@ "\[0:a\]apad=pad_dur=2\[input_padded\]; \[1:a\]apad=whole_len=10000\[impulse_padded\]; \ \[impulse_padded\]volume=5\[impulse\]; \[input_padded\]\[impulse\]afir=dry=10:wet=10\[reverb\]; \ \[0:a\]\[reverb\]amix=inputs=2:weights=8 1\[mixed\]; \[mixed\]highpass=f=200,lowpass=f=14000\[filtered\]; \ - \[filtered\]deesser=i=0.4\[deessed\]; \[deessed\]acrusher=mix=0.1:mode=lin:aa=1:samples=250\[crushed\]; \ + \[filtered\]deesser=i=0.4\[deessed\]; \[deessed\]acrusher=mix=0.05:mode=lin:aa=1:samples=250\[crushed\]; \ \[crushed\]equalizer=f=4000:t=h:width=2000:g=8"\ "} From 340136ad4e0e2acd7e0b47f06a65499ac7693cac Mon Sep 17 00:00:00 2001 From: gaxeer Date: Fri, 17 Jan 2025 19:34:05 +0200 Subject: [PATCH 05/19] proper filename for TTS --- modular_bandastation/tts/code/tts_subsystem.dm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modular_bandastation/tts/code/tts_subsystem.dm b/modular_bandastation/tts/code/tts_subsystem.dm index 7a9bf6fe58a12..423f99cc7d436 100644 --- a/modular_bandastation/tts/code/tts_subsystem.dm +++ b/modular_bandastation/tts/code/tts_subsystem.dm @@ -278,7 +278,7 @@ SUBSYSTEM_DEF(tts220) var/hash = md5(lowertext(text)) - var/filename = "input" + var/filename = "data/tts_cache/[tts_seed.name]/[hash]" var/list/effect_singletons = list() for(var/effect_type in effect_types) effect_singletons += GET_SINGLETON_TYPE_LIST(effect_type) From 7dde4c521361831ae0adab5ffae47fb0c572848d Mon Sep 17 00:00:00 2001 From: gaxeer Date: Fri, 17 Jan 2025 19:46:04 +0200 Subject: [PATCH 06/19] TTS_TRAIT_RATE_MEDIUM by default --- modular_bandastation/tts/code/tts_subsystem.dm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modular_bandastation/tts/code/tts_subsystem.dm b/modular_bandastation/tts/code/tts_subsystem.dm index 423f99cc7d436..6809fca2bbeb0 100644 --- a/modular_bandastation/tts/code/tts_subsystem.dm +++ b/modular_bandastation/tts/code/tts_subsystem.dm @@ -234,7 +234,7 @@ SUBSYSTEM_DEF(tts220) datum/tts_seed/tts_seed, is_local = TRUE, list/effect_types, - traits = TTS_TRAIT_RATE_FASTER, + traits = TTS_TRAIT_RATE_MEDIUM, preSFX = null, postSFX = null ) From 31c5c390f9f309fbd7b4f7e297011cc8346f8159 Mon Sep 17 00:00:00 2001 From: gaxeer Date: Fri, 17 Jan 2025 21:28:17 +0200 Subject: [PATCH 07/19] fix message_mods access runtime --- modular_bandastation/tts/code/tts_hear.dm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modular_bandastation/tts/code/tts_hear.dm b/modular_bandastation/tts/code/tts_hear.dm index 4d0e3e60925d0..b097ff8455ee5 100644 --- a/modular_bandastation/tts/code/tts_hear.dm +++ b/modular_bandastation/tts/code/tts_hear.dm @@ -19,7 +19,7 @@ var/dist = get_dist(speaker, src) - message_range if(dist > 0 && dist <= EAVESDROP_EXTRA_RANGE && !HAS_TRAIT(src, TRAIT_GOOD_HEARING) && !isobserver(src)) return - speaker.cast_tts(src, raw_message, is_local = (message_range != INFINITY), is_radio = !!radio_freq, effects = message_mods[MODE_TTS_FILTERS]) + speaker.cast_tts(src, raw_message, is_local = (message_range != INFINITY), is_radio = !!radio_freq, effects = LAZYACCESS(message_mods[MODE_TTS_FILTERS])) /mob/dead/observer/Hear(message, atom/movable/speaker, datum/language/message_language, raw_message, radio_freq, list/spans, list/message_mods, message_range) . = ..() From ee11171d867e20705038da7db96d7e1a47d99639 Mon Sep 17 00:00:00 2001 From: gaxeer Date: Fri, 17 Jan 2025 21:33:29 +0200 Subject: [PATCH 08/19] ratge --- modular_bandastation/tts/code/tts_hear.dm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modular_bandastation/tts/code/tts_hear.dm b/modular_bandastation/tts/code/tts_hear.dm index b097ff8455ee5..253aaf95d0607 100644 --- a/modular_bandastation/tts/code/tts_hear.dm +++ b/modular_bandastation/tts/code/tts_hear.dm @@ -19,7 +19,7 @@ var/dist = get_dist(speaker, src) - message_range if(dist > 0 && dist <= EAVESDROP_EXTRA_RANGE && !HAS_TRAIT(src, TRAIT_GOOD_HEARING) && !isobserver(src)) return - speaker.cast_tts(src, raw_message, is_local = (message_range != INFINITY), is_radio = !!radio_freq, effects = LAZYACCESS(message_mods[MODE_TTS_FILTERS])) + speaker.cast_tts(src, raw_message, is_local = (message_range != INFINITY), is_radio = !!radio_freq, effects = LAZYACCESS(message_mods, MODE_TTS_FILTERS)) /mob/dead/observer/Hear(message, atom/movable/speaker, datum/language/message_language, raw_message, radio_freq, list/spans, list/message_mods, message_range) . = ..() From 59f1a3adbb7c04e4dc818eb3b594c2fe2bf175e0 Mon Sep 17 00:00:00 2001 From: gaxeer Date: Sat, 18 Jan 2025 15:34:52 +0200 Subject: [PATCH 09/19] add comments to sound_effect singleton vars, update `announcement` filter --- modular_bandastation/tts/code/shell.dm | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/modular_bandastation/tts/code/shell.dm b/modular_bandastation/tts/code/shell.dm index fddd0e2549461..d9b0ddcfa65f1 100644 --- a/modular_bandastation/tts/code/shell.dm +++ b/modular_bandastation/tts/code/shell.dm @@ -38,10 +38,13 @@ return TRUE /datum/singleton/sound_effect + /// If set to TRUE, this effect will ignore all other filters. var/complex = FALSE + /// Text suffix used for caching file with specific effects. var/suffix + /// Filter arguments passed to ffmpeg. var/ffmpeg_arguments - /// If set to TRUE, this effect will ignore all other filters. + /datum/singleton/sound_effect/radio suffix = "_radio" @@ -60,11 +63,11 @@ suffix = "_announcement" ffmpeg_arguments = {"\ -i ./tools/tts/tts-api/RoomImpulse.wav -filter_complex \ - "\[0:a\]apad=pad_dur=2\[input_padded\]; \[1:a\]apad=whole_len=10000\[impulse_padded\]; \ - \[impulse_padded\]volume=5\[impulse\]; \[input_padded\]\[impulse\]afir=dry=10:wet=10\[reverb\]; \ - \[0:a\]\[reverb\]amix=inputs=2:weights=8 1\[mixed\]; \[mixed\]highpass=f=200,lowpass=f=14000\[filtered\]; \ - \[filtered\]deesser=i=0.4\[deessed\]; \[deessed\]acrusher=mix=0.05:mode=lin:aa=1:samples=250\[crushed\]; \ - \[crushed\]equalizer=f=4000:t=h:width=2000:g=8"\ + "\[0:a\]apad=pad_dur=2\[input_padded\]; \ + \[input_padded\]\[1:a\]afir=dry=10:wet=8\[reverb\]; \ + \[0:a\]\[reverb\]amix=inputs=2:weights=10 1\[mixed\]; \ + \[mixed\]highpass=f=200,lowpass=f=12000\[filtered\]; \ + \[filtered\]deesser=i=0.4"\ "} #undef SHELLEO_ERRORLEVEL From 50a4c2025b195095483bf7c3317835d6d3eb01f1 Mon Sep 17 00:00:00 2001 From: gaxeer Date: Sat, 18 Jan 2025 15:56:40 +0200 Subject: [PATCH 10/19] add output log to ffmpeg (TM only) --- modular_bandastation/tts/code/shell.dm | 3 +++ 1 file changed, 3 insertions(+) diff --git a/modular_bandastation/tts/code/shell.dm b/modular_bandastation/tts/code/shell.dm index d9b0ddcfa65f1..ff1a7bc46db92 100644 --- a/modular_bandastation/tts/code/shell.dm +++ b/modular_bandastation/tts/code/shell.dm @@ -34,6 +34,9 @@ log_runtime("Error: apply_sound_effects([effect_types], [filename_input], [filename_output]) - See debug logs.") logger.Log(LOG_CATEGORY_DEBUG, "apply_sound_effects([effect_types], [filename_input], [filename_output]) STDOUT: [stdout]") logger.Log(LOG_CATEGORY_DEBUG, "apply_sound_effects([effect_types], [filename_input], [filename_output]) STDERR: [stderr]") + else + message_admins("ffmpeg output: [stdout]") + log_admin("ffmpeg output: [stdout]") return FALSE return TRUE From e640ef1dd70642f623cd2352955f00dadb2a57eb Mon Sep 17 00:00:00 2001 From: gaxeer Date: Sat, 18 Jan 2025 16:00:18 +0200 Subject: [PATCH 11/19] enable SShttp logging --- modular_bandastation/tts/code/SSHttp.dm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modular_bandastation/tts/code/SSHttp.dm b/modular_bandastation/tts/code/SSHttp.dm index cc4196e8a6259..cc7db97453d21 100644 --- a/modular_bandastation/tts/code/SSHttp.dm +++ b/modular_bandastation/tts/code/SSHttp.dm @@ -7,7 +7,7 @@ SUBSYSTEM_DEF(http) /// List of all async HTTP requests in the processing chain var/list/datum/http_request/active_async_requests = list() /// Variable to define if logging is enabled or not. Disabled by default since we know the requests the server is making. Enable with VV if you need to debug requests - var/logging_enabled = FALSE + var/logging_enabled = TRUE /// Total requests the SS has processed in a round var/total_requests From 67cdc1c63c11e2b43d6e00f7c04dc22ddd40c9e8 Mon Sep 17 00:00:00 2001 From: gaxeer Date: Sat, 18 Jan 2025 16:36:35 +0200 Subject: [PATCH 12/19] fix effect application --- modular_bandastation/tts/code/shell.dm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modular_bandastation/tts/code/shell.dm b/modular_bandastation/tts/code/shell.dm index ff1a7bc46db92..4892c30b090c7 100644 --- a/modular_bandastation/tts/code/shell.dm +++ b/modular_bandastation/tts/code/shell.dm @@ -34,10 +34,10 @@ log_runtime("Error: apply_sound_effects([effect_types], [filename_input], [filename_output]) - See debug logs.") logger.Log(LOG_CATEGORY_DEBUG, "apply_sound_effects([effect_types], [filename_input], [filename_output]) STDOUT: [stdout]") logger.Log(LOG_CATEGORY_DEBUG, "apply_sound_effects([effect_types], [filename_input], [filename_output]) STDERR: [stderr]") + return FALSE else message_admins("ffmpeg output: [stdout]") log_admin("ffmpeg output: [stdout]") - return FALSE return TRUE /datum/singleton/sound_effect From 87969d5e7177650db4e25a8160cccd44d2644865 Mon Sep 17 00:00:00 2001 From: gaxeer Date: Sat, 18 Jan 2025 17:30:26 +0200 Subject: [PATCH 13/19] remove header logging --- modular_bandastation/tts/code/SSHttp.dm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modular_bandastation/tts/code/SSHttp.dm b/modular_bandastation/tts/code/SSHttp.dm index cc7db97453d21..21b1f140312c2 100644 --- a/modular_bandastation/tts/code/SSHttp.dm +++ b/modular_bandastation/tts/code/SSHttp.dm @@ -34,7 +34,7 @@ SUBSYSTEM_DEF(http) else log_data += "\tResponse status code: [res.status_code]" log_data += "\tResponse body: [res.body]" - log_data += "\tResponse headers: [json_encode(res.headers)]" + // log_data += "\tResponse headers: [json_encode(res.headers)]" // Don't log headers for now log_data += "END ASYNC RESPONSE (ID: [req.id])" logger.Log(LOG_CATEGORY_DEBUG, log_data.Join("\n")) @@ -61,7 +61,7 @@ SUBSYSTEM_DEF(http) log_data += "BEGIN ASYNC REQUEST (ID: [req.id])" log_data += "\t[uppertext(req.method)] [req.url]" log_data += "\tRequest body: [req.body]" - log_data += "\tRequest headers: [req.headers]" + // log_data += "\tRequest headers: [req.headers]" // Don't log headers for now log_data += "END ASYNC REQUEST (ID: [req.id])" // Write the log data From 2670381d7624ccb1640b0f365c204539aa8e319b Mon Sep 17 00:00:00 2001 From: gaxeer Date: Sat, 18 Jan 2025 19:17:48 +0200 Subject: [PATCH 14/19] remove http logging --- modular_bandastation/tts/code/SSHttp.dm | 2 +- modular_bandastation/tts/code/shell.dm | 4 +--- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/modular_bandastation/tts/code/SSHttp.dm b/modular_bandastation/tts/code/SSHttp.dm index 21b1f140312c2..dd9e05cf7dcd8 100644 --- a/modular_bandastation/tts/code/SSHttp.dm +++ b/modular_bandastation/tts/code/SSHttp.dm @@ -7,7 +7,7 @@ SUBSYSTEM_DEF(http) /// List of all async HTTP requests in the processing chain var/list/datum/http_request/active_async_requests = list() /// Variable to define if logging is enabled or not. Disabled by default since we know the requests the server is making. Enable with VV if you need to debug requests - var/logging_enabled = TRUE + var/logging_enabled = FALSE /// Total requests the SS has processed in a round var/total_requests diff --git a/modular_bandastation/tts/code/shell.dm b/modular_bandastation/tts/code/shell.dm index 4892c30b090c7..9b6adaf016bed 100644 --- a/modular_bandastation/tts/code/shell.dm +++ b/modular_bandastation/tts/code/shell.dm @@ -35,9 +35,7 @@ logger.Log(LOG_CATEGORY_DEBUG, "apply_sound_effects([effect_types], [filename_input], [filename_output]) STDOUT: [stdout]") logger.Log(LOG_CATEGORY_DEBUG, "apply_sound_effects([effect_types], [filename_input], [filename_output]) STDERR: [stderr]") return FALSE - else - message_admins("ffmpeg output: [stdout]") - log_admin("ffmpeg output: [stdout]") + return TRUE /datum/singleton/sound_effect From 20583820006b03f9df5c2e6001fbe1c4a12e55b8 Mon Sep 17 00:00:00 2001 From: gaxeer Date: Sat, 18 Jan 2025 22:48:40 +0200 Subject: [PATCH 15/19] adjust tts filter for announcements --- modular_bandastation/tts/code/shell.dm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modular_bandastation/tts/code/shell.dm b/modular_bandastation/tts/code/shell.dm index 9b6adaf016bed..ef46acc95df14 100644 --- a/modular_bandastation/tts/code/shell.dm +++ b/modular_bandastation/tts/code/shell.dm @@ -67,7 +67,7 @@ "\[0:a\]apad=pad_dur=2\[input_padded\]; \ \[input_padded\]\[1:a\]afir=dry=10:wet=8\[reverb\]; \ \[0:a\]\[reverb\]amix=inputs=2:weights=10 1\[mixed\]; \ - \[mixed\]highpass=f=200,lowpass=f=12000\[filtered\]; \ + \[mixed\]highpass=f=200,lowpass=f=14000\[filtered\]; \ \[filtered\]deesser=i=0.4"\ "} From 77bb9099300d014191accc14b1a26852cf82ce9f Mon Sep 17 00:00:00 2001 From: dj-34 Date: Sun, 19 Jan 2025 19:05:22 +0500 Subject: [PATCH 16/19] update filter --- modular_bandastation/tts/code/shell.dm | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/modular_bandastation/tts/code/shell.dm b/modular_bandastation/tts/code/shell.dm index ef46acc95df14..c1b7e3ebe617c 100644 --- a/modular_bandastation/tts/code/shell.dm +++ b/modular_bandastation/tts/code/shell.dm @@ -63,12 +63,10 @@ complex = TRUE suffix = "_announcement" ffmpeg_arguments = {"\ - -i ./tools/tts/tts-api/RoomImpulse.wav -filter_complex \ - "\[0:a\]apad=pad_dur=2\[input_padded\]; \ - \[input_padded\]\[1:a\]afir=dry=10:wet=8\[reverb\]; \ - \[0:a\]\[reverb\]amix=inputs=2:weights=10 1\[mixed\]; \ - \[mixed\]highpass=f=200,lowpass=f=14000\[filtered\]; \ - \[filtered\]deesser=i=0.4"\ + -i ./tools/tts/tts-api/RoomImpulse.wav -filter_complex \ + "\[0:a\]apad=pad_dur=2\[dry\]; \ + \[0:a\]apad=pad_dur=2,afir=dry=10:wet=10\[wet\]; \ + \[dry\]\[wet\]amix=weights='1 0.1',acrusher=mix=0.1:mode=lin:aa=1:samples=250,highpass=f=200,lowpass=f=10000,alimiter=limit=-1dB:level=false:asc=true"\ "} #undef SHELLEO_ERRORLEVEL From 2f6337b37b39b4b5ec1c65b23e21ebfed1195a17 Mon Sep 17 00:00:00 2001 From: Gaxeer <44334376+Gaxeer@users.noreply.github.com> Date: Sun, 19 Jan 2025 18:22:08 +0200 Subject: [PATCH 17/19] Update modular_bandastation/tts/code/SSHttp.dm --- modular_bandastation/tts/code/SSHttp.dm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modular_bandastation/tts/code/SSHttp.dm b/modular_bandastation/tts/code/SSHttp.dm index dd9e05cf7dcd8..537ad4e0690d4 100644 --- a/modular_bandastation/tts/code/SSHttp.dm +++ b/modular_bandastation/tts/code/SSHttp.dm @@ -61,7 +61,7 @@ SUBSYSTEM_DEF(http) log_data += "BEGIN ASYNC REQUEST (ID: [req.id])" log_data += "\t[uppertext(req.method)] [req.url]" log_data += "\tRequest body: [req.body]" - // log_data += "\tRequest headers: [req.headers]" // Don't log headers for now + log_data += "\tRequest headers: [req.headers]" // Don't log headers for now log_data += "END ASYNC REQUEST (ID: [req.id])" // Write the log data From 1e1746e65a7a90cea008d2d621375328bb9ab18e Mon Sep 17 00:00:00 2001 From: Gaxeer <44334376+Gaxeer@users.noreply.github.com> Date: Sun, 19 Jan 2025 18:22:22 +0200 Subject: [PATCH 18/19] Update modular_bandastation/tts/code/SSHttp.dm --- modular_bandastation/tts/code/SSHttp.dm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modular_bandastation/tts/code/SSHttp.dm b/modular_bandastation/tts/code/SSHttp.dm index 537ad4e0690d4..e4dbbcdc40763 100644 --- a/modular_bandastation/tts/code/SSHttp.dm +++ b/modular_bandastation/tts/code/SSHttp.dm @@ -34,7 +34,7 @@ SUBSYSTEM_DEF(http) else log_data += "\tResponse status code: [res.status_code]" log_data += "\tResponse body: [res.body]" - // log_data += "\tResponse headers: [json_encode(res.headers)]" // Don't log headers for now + log_data += "\tResponse headers: [json_encode(res.headers)]" // Don't log headers for now log_data += "END ASYNC RESPONSE (ID: [req.id])" logger.Log(LOG_CATEGORY_DEBUG, log_data.Join("\n")) From f5157b3925eb7099be81d255128a49bd55831f52 Mon Sep 17 00:00:00 2001 From: Gaxeer <44334376+Gaxeer@users.noreply.github.com> Date: Sun, 19 Jan 2025 18:28:32 +0200 Subject: [PATCH 19/19] Apply suggestions from code review --- modular_bandastation/tts/code/SSHttp.dm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modular_bandastation/tts/code/SSHttp.dm b/modular_bandastation/tts/code/SSHttp.dm index e4dbbcdc40763..cc4196e8a6259 100644 --- a/modular_bandastation/tts/code/SSHttp.dm +++ b/modular_bandastation/tts/code/SSHttp.dm @@ -34,7 +34,7 @@ SUBSYSTEM_DEF(http) else log_data += "\tResponse status code: [res.status_code]" log_data += "\tResponse body: [res.body]" - log_data += "\tResponse headers: [json_encode(res.headers)]" // Don't log headers for now + log_data += "\tResponse headers: [json_encode(res.headers)]" log_data += "END ASYNC RESPONSE (ID: [req.id])" logger.Log(LOG_CATEGORY_DEBUG, log_data.Join("\n")) @@ -61,7 +61,7 @@ SUBSYSTEM_DEF(http) log_data += "BEGIN ASYNC REQUEST (ID: [req.id])" log_data += "\t[uppertext(req.method)] [req.url]" log_data += "\tRequest body: [req.body]" - log_data += "\tRequest headers: [req.headers]" // Don't log headers for now + log_data += "\tRequest headers: [req.headers]" log_data += "END ASYNC REQUEST (ID: [req.id])" // Write the log data