Skip to content

Conversation

@rh101
Copy link
Contributor

@rh101 rh101 commented Sep 18, 2025

Describe your changes

Reverb effect is implemented, with preset reverb settings available that developers can use (in AudioEffects.h)

A simple test that loops through a few of the reverb effects is in the audio test section of cpp-tests.

@halx99 I wasn't sure what to name the files, so if you need anything changed, then let me know and I'll sort it out.

Issue ticket number and link

#2726

Checklist before requesting a review

For each PR

  • Add Copyright if it missed:
    - "Copyright (c) 2019-present Axmol Engine contributors (see AUTHORS.md)."

  • I have performed a self-review of my code.

    Optional:

    • I have checked readme and add important infos to this PR.
    • I have added/adapted some tests too.

For core/new feature PR

  • I have checked readme and add important infos to this PR.
  • I have added thorough tests.

Axmol 3.x ------------------------------------------------------------

For each 3.x PR

  • Check the '#include "axmol.h"' and replace it with the needed headers.

@rh101 rh101 marked this pull request as draft September 18, 2025 15:52
@rh101
Copy link
Contributor Author

rh101 commented Sep 18, 2025

@halx99 For Apple and Wasm, does the alext.h not exist on those platforms? I can see this in the alconfig.h:

#if !defined(__APPLE__) && !defined(__EMSCRIPTEN__)
#    if !defined(AX_USE_ALSOFT)
#        define AX_USE_ALSOFT 1
#    endif
#endif

#if defined(__EMSCRIPTEN__)
    #import <AL/al.h>
    #import <AL/alc.h>
    #define MAX_AUDIOINSTANCES 128
#else
    #if !AX_USE_ALSOFT
    #    import <OpenAL/al.h>
    #    import <OpenAL/alc.h>
    #    define MAX_AUDIOINSTANCES 128
    #else
    #    define AL_ALEXT_PROTOTYPES 1
    #    include "AL/al.h"
    #    include "AL/alc.h"
    #    include "AL/alext.h"
    #    define MAX_AUDIOINSTANCES 128
    #endif
#endif

@rh101
Copy link
Contributor Author

rh101 commented Sep 18, 2025

Is ALC_EXT_EFX is not defined, and not equal to 1, then the effects code will no longer be compiled, and won't be supported for that build. Other than that, I'm not sure how else to deal with this at the moment.

Clear effect slots if effect is disabled.
@halx99
Copy link
Collaborator

halx99 commented Sep 19, 2025

I think, the class AudioEffectsExtensionOpenAL should be rename to AudioEffectsExtension due to the audio engine only based on openal

@halx99 halx99 added this to the 2.9.0 milestone Sep 19, 2025
@rh101 rh101 marked this pull request as ready for review September 19, 2025 01:54
@halx99
Copy link
Collaborator

halx99 commented Sep 19, 2025

ALC_EXT_EFX

wasm alext.h exist, but no ALC_EXT_EFX in it: https://github.com/emscripten-core/emscripten/blob/main/system/include/AL/alext.h

@rh101
Copy link
Contributor Author

rh101 commented Sep 19, 2025

wasm alext.h exist, but no ALC_EXT_EFX in it: https://github.com/emscripten-core/emscripten/blob/main/system/include/AL/alext.h

That is unfortunate, so it means audio effects will not be supported on both WASM and iOS/MacOS. All other target platforms seem to work fine.

@halx99
Copy link
Collaborator

halx99 commented Sep 19, 2025

Yes, you can just check whether AX_USE_ALSOFT defined in cmake and c++ files.

@rh101
Copy link
Contributor Author

rh101 commented Sep 19, 2025

Yes, you can just check whether AX_USE_ALSOFT defined in cmake and c++ files.

Will do.

@halx99
Copy link
Collaborator

halx99 commented Sep 19, 2025

That is unfortunate, so it means audio effects will not be supported on both WASM and iOS/MacOS. All other target platforms seem to work fine.

On dev(v3), axmol can forcing AX_USE_ALSOFT=ON for all platforms include wasm (PR #2775) , macos, ios. in the future maybe v3, we can make openal-soft as default OpenAL vender for all platforms which is supported by axmol.

@halx99 halx99 added the enhancement New feature or request label Sep 19, 2025
@rh101 rh101 marked this pull request as draft September 19, 2025 23:05
@rh101
Copy link
Contributor Author

rh101 commented Sep 19, 2025

On dev(v3), axmol can forcing AX_USE_ALSOFT=ON for all platforms include wasm (PR #2775) , macos, ios. in the future maybe v3, we can make openal-soft as default OpenAL vender for all platforms which is supported by axmol.

That would be good, keeping a consistent interface and feature set for developers on all platforms.

halx99
halx99 previously approved these changes Sep 19, 2025
@rh101 rh101 marked this pull request as ready for review September 19, 2025 23:40
@rh101 rh101 marked this pull request as draft September 20, 2025 02:23
@rh101 rh101 marked this pull request as ready for review September 20, 2025 03:26
@halx99
Copy link
Collaborator

halx99 commented Sep 20, 2025

lgtm, will merge later

@halx99 halx99 merged commit 862f3af into axmolengine:release/2.x Sep 20, 2025
15 checks passed
@halx99
Copy link
Collaborator

halx99 commented Sep 20, 2025

I got error when merge to dev(v3), not sure does release/2.x works, will test later

[ALSOFT] (WW) Error generated on context 0x2a2bfc32120, code 0xa003, "EAX Reverb hfreference out of range"
Exception thrown at 0x00007FFFF27A804A in cpp-tests.exe: Microsoft C++ exception: al::base_exception at memory location 0x000000FC68DFE990.
E/[2025-09-20 15:53:47.975][PID:74d4][TID:ba88]OpenAL error 0xA003 in D:\dev\simdsoft\axmol\axmol\audio\AudioEffectsExtension.cpp ax::AudioEffectsExtension::setEffectParamFloat 90

[ALSOFT] (WW) Error generated on context 0x2a2bfc32120, code 0xa003, "EAX Reverb lfreference out of range"
Exception thrown at 0x00007FFFF27A804A in cpp-tests.exe: Microsoft C++ exception: al::base_exception at memory location 0x000000FC68DFE990.
E/[2025-09-20 15:53:47.977][PID:74d4][TID:ba88]OpenAL error 0xA003 in D:\dev\simdsoft\axmol\axmol\audio\AudioEffectsExtension.cpp ax::AudioEffectsExtension::setEffectParamFloat 90

[ALSOFT] (WW) Error generated on context 0x2a2bfc32120, code 0xa003, "EAX Reverb hfreference out of range"
Exception thrown at 0x00007FFFF27A804A in cpp-tests.exe: Microsoft C++ exception: al::base_exception at memory location 0x000000FC68DFE990.
E/[2025-09-20 15:53:50.974][PID:74d4][TID:ba88]OpenAL error 0xA003 in D:\dev\simdsoft\axmol\axmol\audio\AudioEffectsExtension.cpp ax::AudioEffectsExtension::setEffectParamFloat 90

[ALSOFT] (WW) Error generated on context 0x2a2bfc32120, code 0xa003, "EAX Reverb lfreference out of range"
Exception thrown at 0x00007FFFF27A804A in cpp-tests.exe: Microsoft C++ exception: al::base_exception at memory location 0x000000FC68DFE990.
E/[2025-09-20 15:53:50.976][PID:74d4][TID:ba88]OpenAL error 0xA003 in D:\dev\simdsoft\axmol\axmol\audio\AudioEffectsExtension.cpp ax::AudioEffectsExtension::setEffectParamFloat 90

@halx99
Copy link
Collaborator

halx99 commented Sep 20, 2025

I got error when merge to dev(v3), not sure does release/2.x works, will test later

[ALSOFT] (WW) Error generated on context 0x2a2bfc32120, code 0xa003, "EAX Reverb hfreference out of range"
Exception thrown at 0x00007FFFF27A804A in cpp-tests.exe: Microsoft C++ exception: al::base_exception at memory location 0x000000FC68DFE990.
E/[2025-09-20 15:53:47.975][PID:74d4][TID:ba88]OpenAL error 0xA003 in D:\dev\simdsoft\axmol\axmol\audio\AudioEffectsExtension.cpp ax::AudioEffectsExtension::setEffectParamFloat 90

[ALSOFT] (WW) Error generated on context 0x2a2bfc32120, code 0xa003, "EAX Reverb lfreference out of range"
Exception thrown at 0x00007FFFF27A804A in cpp-tests.exe: Microsoft C++ exception: al::base_exception at memory location 0x000000FC68DFE990.
E/[2025-09-20 15:53:47.977][PID:74d4][TID:ba88]OpenAL error 0xA003 in D:\dev\simdsoft\axmol\axmol\audio\AudioEffectsExtension.cpp ax::AudioEffectsExtension::setEffectParamFloat 90

[ALSOFT] (WW) Error generated on context 0x2a2bfc32120, code 0xa003, "EAX Reverb hfreference out of range"
Exception thrown at 0x00007FFFF27A804A in cpp-tests.exe: Microsoft C++ exception: al::base_exception at memory location 0x000000FC68DFE990.
E/[2025-09-20 15:53:50.974][PID:74d4][TID:ba88]OpenAL error 0xA003 in D:\dev\simdsoft\axmol\axmol\audio\AudioEffectsExtension.cpp ax::AudioEffectsExtension::setEffectParamFloat 90

[ALSOFT] (WW) Error generated on context 0x2a2bfc32120, code 0xa003, "EAX Reverb lfreference out of range"
Exception thrown at 0x00007FFFF27A804A in cpp-tests.exe: Microsoft C++ exception: al::base_exception at memory location 0x000000FC68DFE990.
E/[2025-09-20 15:53:50.976][PID:74d4][TID:ba88]OpenAL error 0xA003 in D:\dev\simdsoft\axmol\axmol\audio\AudioEffectsExtension.cpp ax::AudioEffectsExtension::setEffectParamFloat 90

release/2.x same error

@rh101
Copy link
Contributor Author

rh101 commented Sep 20, 2025

I'll take a look

@rh101 rh101 deleted the audio-reverb branch September 20, 2025 08:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants