-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Replace audio backend with miniaudio #2749
Conversation
I took a shot at rebasing and fixing merge conflicts. Some of the conflicts were easily fixed but I'm still not sure I correctly fixed the conflicts in src/SFML/Audio/Sound.cpp. I can't get it to compile. |
1b650b3
to
137ab63
Compare
I have most of the build errors fixed and removed all the imgui and imgui-sfml source code. I still need to fix compiler warnings and clang-tidy errors but this PR is at least in a state where it passes most of CI which means more people should be able to test it out. The iOS jobs fail for reasons I don't totally understand. It's hopefully a matter of ensuring that Obj-C headers are being compiled as Obj-C instead of C or C++. Hopefully miniaudio actually works on iOS or else this PR is going to have a pretty tough decision to make. |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #2749 +/- ##
==========================================
- Coverage 43.65% 42.76% -0.90%
==========================================
Files 253 253
Lines 20940 22019 +1079
Branches 5139 5440 +301
==========================================
+ Hits 9142 9417 +275
- Misses 10785 11717 +932
+ Partials 1013 885 -128
... and 61 files with indirect coverage changes Continue to review full report in Codecov by Sentry.
|
miniaudio officially supports iOS and building for it even has a dedicated subsection in its documentation. |
25b0fc0
to
28ddb70
Compare
I've fixed almost all of the compiler warnings. The last one to address is here where MinGW appears to have found a null dereference inside of mini audio. I'm not sure if this warning is triggered by code we wrote or what. We'll probably just Lastly I still have to fix those iOS jobs and then'll have 100% green CI :) |
2b60477
to
3785c81
Compare
I was able to fix the iOS build errors and added and workaround to deal with that MinGW warning that I didn't otherwise know how to fix. CI should be 100% green now! |
b53a5c5
to
c09a017
Compare
c09a017
to
65f5c3d
Compare
src/SFML/Audio/Sound.cpp
Outdated
//////////////////////////////////////////////////////////// | ||
void* Sound::getSound() const | ||
{ | ||
return &m_impl->m_sound; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
#2640 made sure that a sound always had an associated sound buffer but that was merged after this PR's branch was originally started. We need to make sure that this new implementation maintains that same property. I'd expect the underlying pointers within the implementation to always be non-null no matter how a user may use the API.
a69b9ff
to
ed4d0b4
Compare
Rebased on |
e4cf57e
to
38e40d2
Compare
Rebased on |
fb723e6
to
a13f54b
Compare
I reenabled the clang-tidy check which is catching this pure virtual function call bug so that we can get better feedback once we start trying to fix it. |
a13f54b
to
69f2958
Compare
@danieljpetersen The pure virtual method call issue should be fixed now. |
The unit tests in #2927 are still crashing on the copy construction of |
69f2958
to
6d30dcf
Compare
My Audio unit tests are now passing without any crashes. There is however this oddity in the SECTION("Set/get pitch")
{
SoundSource soundSource;
soundSource.setPitch(42);
CHECK(soundSource.getPitch() == 0); // Why not 42 here?
}
SECTION("Set/get volume")
{
SoundSource soundSource;
soundSource.setVolume(0.5f);
CHECK(soundSource.getVolume() == 0);
}
SECTION("Set/get position")
{
SoundSource soundSource;
soundSource.setPosition({1, 2, 3});
CHECK(soundSource.getPosition() == sf::Vector3f());
}
SECTION("Set/get relative to listener")
{
SoundSource soundSource;
soundSource.setRelativeToListener(true);
CHECK(!soundSource.isRelativeToListener());
}
SECTION("Set/get min distance")
{
SoundSource soundSource;
soundSource.setMinDistance(12.34f);
CHECK(soundSource.getMinDistance() == 0);
}
SECTION("Set/get attenuation")
{
SoundSource soundSource;
soundSource.setAttenuation(10);
CHECK(soundSource.getAttenuation() == 0);
} The setters and getters seem to just not work. Setting a value does not result in being about to get the old value. The setters and getters behave as one would expect with the OpenAL backend. |
655c36c
to
7839348
Compare
|
CI is failing due to Homebrew updating clang-tidy which includes some new checks. I fixed that in #2953. |
Thank you Binary! That did indeed fix it. And thank you Bambo, thank you Thrasher! Yesterday I wrote a little sound interpolator for the audio section of my codebase, where you give a duration and an easing formula for any given music/sound property(s). I've got it working in my game now to transition music on scene changes, it's especially nice when going from high tempo to low tempo music. I'm looking forward to whenever this gets merged into master. |
7839348
to
5b22445
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The assets of the new example need to be referenced in the asset_licenses.md file.
It's a really cool PR! 😎
Beyond getting rid or OpenAL and its LGPL implications, it's awesome to see the natural use of SFML 3 features like Angle and C++17(-ish). 🎉
…s to multiple modules. Co-authored-by: Chris Thrasher <chrisjthrasher@gmail.com>
Co-authored-by: Chris Thrasher <chrisjthrasher@gmail.com> Co-authored-by: kimci86 <kimci86@hotmail.fr> Co-authored-by: vittorioromeo <mail@vittorioromeo.com>
5b22445
to
13490da
Compare
Rebased and updated. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The asset_licenses.md file still needs updating, but we can do that later as well. 😊
Big thanks to @binary1248 for taking on this work and everyone for reviewing! 🎉 |
By popular demand.
Work in progress.
Here be dragons.