Skip to content
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

Refactor AmbientSound #2688

Merged
merged 10 commits into from
Jan 4, 2024
Merged

Conversation

mrkubax10
Copy link
Member

@mrkubax10 mrkubax10 commented Dec 1, 2023

Implements new SoundObject object that is hearable in entire Sector. It is possible to change it's volume and looping sound play interval. Attempts to fix the long-broken AmbientSound.

@mrkubax10 mrkubax10 added involves:functionality status:needs-discussion Team member and developers need to discuss of decisions type:feature category:code involves:scripting status:needs-review Work needs to be reviewed by other people labels Dec 1, 2023
@mrkubax10 mrkubax10 marked this pull request as draft December 1, 2023 20:48
@mrkubax10 mrkubax10 added status:in-progress Progress has been done, but more is intended be done and removed status:needs-review Work needs to be reviewed by other people labels Dec 2, 2023
@mrkubax10 mrkubax10 force-pushed the ambient_sound_refactor branch from fbac6d9 to 02d78ee Compare December 2, 2023 19:03
@mrkubax10 mrkubax10 marked this pull request as ready for review December 5, 2023 15:44
src/object/ambient_sound.cpp Outdated Show resolved Hide resolved
src/object/ambient_sound.cpp Outdated Show resolved Hide resolved
src/object/ambient_sound.cpp Outdated Show resolved Hide resolved
src/object/ambient_sound.hpp Outdated Show resolved Hide resolved
src/object/sound_object.cpp Outdated Show resolved Hide resolved
src/scripting/sound_object.hpp Outdated Show resolved Hide resolved
@mrkubax10 mrkubax10 requested a review from Vankata453 December 7, 2023 17:07
Copy link
Member

@Vankata453 Vankata453 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good code-wise.

Copy link
Member

@Rusty-Box Rusty-Box left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The "Sound Object" (imo. it's name should be displayed as just "Sound" when hovering over it in the editor, since the music one is also is simply called "Music") has a problem with looping a sound. If the interfall is set to anything above 0 it only plays the sound once. Set it to 0 or a negative and after the sound has played fully once, it will bug out (I tested it with "sounds/rain.wav" which is 25 seconds long).

@mrkubax10
Copy link
Member Author

This seems to be some sort of OpenAL issue because it works fine with short sounds. Apparently after playing once sound source drops the attached buffer data? Not sure.

@mrkubax10 mrkubax10 removed the status:needs-discussion Team member and developers need to discuss of decisions label Dec 10, 2023
@Rusty-Box Rusty-Box added this to the 0.7.0 milestone Dec 26, 2023
@Rusty-Box
Copy link
Member

Seems like the sound looping remains the only major issue with this one. Otherwise the rest seems be fine, aside the display name change for consistency

@mrkubax10
Copy link
Member Author

Maybe dropping interval setting and using internal OpenAL looping feature would be a good enough solution?

@Rusty-Box
Copy link
Member

Would be worth a try, I suppose.

@mrkubax10 mrkubax10 requested a review from Rusty-Box January 3, 2024 20:14
Copy link
Member

@Rusty-Box Rusty-Box left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking good. That seems to have fixed the looping issue - approve!

src/object/ambient_sound.cpp Outdated Show resolved Hide resolved
src/object/ambient_sound.cpp Outdated Show resolved Hide resolved
src/object/sound_object.cpp Outdated Show resolved Hide resolved
src/object/ambient_sound.cpp Outdated Show resolved Hide resolved
@Rusty-Box Rusty-Box merged commit 6788eb0 into SuperTux:master Jan 4, 2024
33 checks passed
@mrkubax10 mrkubax10 deleted the ambient_sound_refactor branch January 5, 2024 15:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants