aboutsummaryrefslogtreecommitdiff
path: root/src/aoblipplayer.cpp
AgeCommit message (Collapse)Author
2026-03-29Rewrite audio engine: replace BASS with miniaudioOsmium Sorcerer
SFX and blip players largely remain the same. For the music player, we now have to implement network streaming natively, we no longer have a convenient function that did everything for us. I introduced QNetworkRequest to download the stream in memory and signal when it's ready to be decoded and played back. The size is guarded to prevent the client from accidentally downloading terabytes of audio. Delete QFutureWatcher, we no longer need it for concurrency. miniaudio uses a separate audio thread. Network donwloads and communication with the track name display are handled by Qt signals. Also, delete an odd "music.txt" feature. Its purpose was specifying offsets for loops in a text file per track, but it remained obscure and unused in practice. Unsupported: - Large streams, including unbounded ones (radio). We'll need a ring buffer for that, and a mechanism to write to it from the network and feed it to the audio thread. - Effect flags: fade in, fade out, sync pos. Ignored. - Audio device selection.
2024-05-17Lightly reworked `NetworkManager`, ...TrickyLeifa
* Lightly reworked `NetworkManager` * Added new modules to handle various connection types. * TCP * WebSocket * Added general string splitter alias based on Qt version. * Replaced `lobby_constructed` and `courtroom_constructed` * Refactored and partially reimplemented the following classes: * `AOBlipPlayer` * `AOEmotePreview` * `AOMusicPlayer` * `AOSfxPlayer` * `AOTextArea`
2024-05-15Ported to CMake, ...TrickyLeifa
* Ported the project to CMake * Android and Mac support dropped for the time being. * Tests, BASS and Discord-RPC are now options * Restructured and reformated the project. * Merged `include` and `src` * Renamed `resource` to `data` * Renamed various files * External libraries headers are no longer included in `src` * Replaced header guards with #pragma once * Multiple refactors (keywords, headers) * Added Qt6 compatibility * Removed various unused functions and headers * Reworked AOPacket * When content is passed to AOPacket, it should be ensured that the content is already decoded. * Encoding/decoding are now static methods. * Fixed various memory leaks * Removed animation code for AOImage * AOImage is always using static images * Simplified ChatLogPiece
2022-07-23Suppress application volume when alt-tabbed (#730)Crystalwarrior
* Suppress application volume when alt-tabbed Add a "suppress_audio" slider setting, 50% by default, which decides how much audio remains when the client is not in focus Add a "muted" setting for blip, music, and sfx players Add update_audio_volume func * change "suppress" to "how much audio is suppressed" instead of "how much audio remains" * Fix last commit just flipping the behavior and being ultra wacky * Fix evidence present sound ignoring audio suppression settings Co-authored-by: stonedDiscord <Tukz@gmx.de> Co-authored-by: Salanto <62221668+Salanto@users.noreply.github.com>
2021-06-18Set BASS_CONFIG_DEV_DEFAULT to 1 to enable automatic reinitialization of the ↵Rose Witchaven
default device when it is lost (#564) fixes #561
2020-09-11Lots of blip rate fixes:Crystalwarrior
Remove qElapsedTimer method of blip earrape protection due to major inconsistency issues with this method (the same message would produce wildly different blip sounds - consistency is preferred) More sophisticated blip earrape prevention is calculated in the chat ticker function itself, it also properly adjusts itself depending on the blip_rate used.
2020-08-19Reset BASS when switching devices; drop Qt Multimedia support (#262)scatterflower
* Allow changing audio device on the fly while in a server * Use default audio device if device in config doesn't exist * Automatically change audio device to default when current one is invalid * Destroy Qt Multimedia support It was decided that there was not enough attention being given to Qt Multimedia support to justify its continued maintenance simply as a libre alternative to BASS. While substantial changes to audio were being made in 2.8, the Qt Multimedia support code fell behind in disrepair. It's clear that there is no vested interest in implementing audio features twice for the sake of licensing. When it's time to switch to another audio library, it will be done unilaterally. * CI: Use BASS for Linux build Co-authored-by: oldmud0 <oldmud0@users.noreply.github.com>
2020-05-23fix up nomusicsD
2020-05-22Fix compile errors from mergeoldmud0
2020-05-22Merge KFO source unconditionally into AO2oldmud0
2020-05-22Perform clang-formatoldmud0
If you don't want to see this commit on blames, use the hidden whitespace option on GitHub, or use `-w` in git-blame.
2020-05-22Full revert to tag 2.6.2oldmud0
Due to a countless number of changes made to the core that were not fully understood, tested, or documented, it was decided to roll everything back to the last known stable version (2.6.2). Changes dropped include: - Witness needed - Shake - Frame SFX - Multiple custom objections - Multithreaded thumbnail generation - Looping - Various translation additions - "Mirror IC" - Color in IC log - An invocation of clang-format Next time, work together and split your big fork into independently testable feature branches.
2020-05-22clang 2 electric boogalooCrystalwarrior
{ BasedOnStyle: LLVM, BreakBeforeBraces: Stroustrup}
2020-05-22Clang-ify the code with this styling using Visual Studio Code:Crystalwarrior
{ BasedOnStyle: LLVM, UseTab: Never, IndentWidth: 4, TabWidth: 4, BreakBeforeBraces: Stroustrup, AllowShortIfStatementsOnASingleLine: false, IndentCaseLabels: false, ColumnLimit: 0, AccessModifierOffset: -4, NamespaceIndentation: All } (this is the Visual Studio preset with only "BreakBeforeBraces" changed from Allman to Stroustrup)
2020-04-17Run clang-format on entire projectoldmud0
Indentation fixed to 2 spaces per tab. Braces set to Stroustrup style. Lines reflow at 80 characters. One-line method bodies are on the same line as the signature. Space always after `//`. No indentation on preprocessor macros. Includes are sorted lexicographically. If you don't want to see this commit on blames, use the hidden whitespace option on GitHub, or use `-w` in git-blame.
2020-03-06ok basssD
2020-03-06fix compiler warnings for unused varssD
2019-11-04Fix the sound bonanza so they actually playCrystalwarrior
sfx player and blip player now both account for extension-less sound paths and also correctly handle paths that do provide the extension.
2019-11-04add .opus supportCrystalwarrior
2019-09-14Add a blip sound QElapsedTimer so blipsounds don't play more frequently than ↵Crystalwarrior
60ms to preserve all of our ears. Adjust the message display speeds to feel more accurate to AA, with }}} speed displaying text instantly for that section
2019-08-17fix qaudio volumestonedDiscord
2019-03-13begone, commented codestonedDiscord
2019-03-13setVolume doesn't take floatsstonedDiscord
2019-03-12qt can play the blips just finestonedDiscord
2019-03-12makes all the bass stuff optionalstonedDiscord
2018-12-26moved headers into include and cpp files into src + logo into resourceDavid Skoland