diff --git a/public/backgrounds/audio/custom/.placeholder b/public/backgrounds/audio/custom/.placeholder new file mode 100644 index 000000000..2931ea7ef --- /dev/null +++ b/public/backgrounds/audio/custom/.placeholder @@ -0,0 +1 @@ +Place your custom background ambient sound file here diff --git a/public/backgrounds/audio/default/bedroom cyberpunk.mp3 b/public/backgrounds/audio/default/bedroom cyberpunk.mp3 new file mode 100644 index 000000000..5bf402ec8 Binary files /dev/null and b/public/backgrounds/audio/default/bedroom cyberpunk.mp3 differ diff --git a/public/backgrounds/audio/default/cityscape medieval market.mp3 b/public/backgrounds/audio/default/cityscape medieval market.mp3 new file mode 100644 index 000000000..b4ba7d3b5 Binary files /dev/null and b/public/backgrounds/audio/default/cityscape medieval market.mp3 differ diff --git a/public/backgrounds/audio/default/cityscape postapoc.mp3 b/public/backgrounds/audio/default/cityscape postapoc.mp3 new file mode 100644 index 000000000..edbda527d Binary files /dev/null and b/public/backgrounds/audio/default/cityscape postapoc.mp3 differ diff --git a/public/backgrounds/audio/default/great-tree.mp3 b/public/backgrounds/audio/default/great-tree.mp3 new file mode 100644 index 000000000..d07906e42 Binary files /dev/null and b/public/backgrounds/audio/default/great-tree.mp3 differ diff --git a/public/backgrounds/audio/default/landscape beach day.mp3 b/public/backgrounds/audio/default/landscape beach day.mp3 new file mode 100644 index 000000000..c3e887bcd Binary files /dev/null and b/public/backgrounds/audio/default/landscape beach day.mp3 differ diff --git a/public/backgrounds/audio/default/landscape winter lake house.mp3 b/public/backgrounds/audio/default/landscape winter lake house.mp3 new file mode 100644 index 000000000..c35ae79a2 Binary files /dev/null and b/public/backgrounds/audio/default/landscape winter lake house.mp3 differ diff --git a/public/scripts/extensions/audio/index.js b/public/scripts/extensions/audio/index.js new file mode 100644 index 000000000..ad4e72b09 --- /dev/null +++ b/public/scripts/extensions/audio/index.js @@ -0,0 +1,352 @@ +/* +TODO: + - Emotion-based BGM + - per character bgms OK + - simple fade out/in when switching OK + - cross fading ? + - Background based ambient sounds + - global sounds OK + - global overides ? + - import option on background UI ? + - One UI with different mixing options OK + - Allow background music edition using background menu + - https://fontawesome.com/icons/music?f=classic&s=solid + - https://codepen.io/noirsociety/pen/rNQxQwm + - https://codepen.io/xrocker/pen/abdKVGy +*/ + +import { saveSettingsDebounced } from "../../../script.js"; +import { getContext, getApiUrl, extension_settings, doExtrasFetch, ModuleWorkerWrapper, modules } from "../../extensions.js"; +export { MODULE_NAME }; + +const MODULE_NAME = 'Audio'; +const DEBUG_PREFIX = "