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

Ogg vorbis supported theme background music #836

Merged
merged 4 commits into from Dec 9, 2022

Conversation

KrahJohlito
Copy link
Member

Pull Request checklist

Note: these are not necessarily requirements

  • I reformatted the code with clang-format
  • I checked to make sure my submission worked
  • I am the author of submission or have permission from the original author
  • Requires update of the PS2SDK or other dependencies
  • Others (please specify below)

Pull Request description

Not the most useful feature but I was bored and saw fjtrujy added libvorbis to ports and thought it might be fun to try get it working.

This adds background music to the internal and external themes in the form of ogg vorbis, just put “bgm.ogg” (all lowercase) into thm/sound folder and enable BGM.

Made some alterations to sound.c to tidy and kind of complete the audio system. There were a couple instances where the music would stutter so I’ve worked around the issue for now by muting playback and left it as a seperate commit in case some improved way is ever found.
Those instances are as follows: Changing video mode, changing language, saving config.

Also added myself to about page.. cause why not..

Can’t seem to find the request review maybe cause I’m on my phone so… requesting review from @uyjulian and @rickgaiser if he’s around.

Big thanks to @sp193 who helped me a lot when I was starting out.

Copy link
Member

@uyjulian uyjulian left a comment

Choose a reason for hiding this comment

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

Hmm... I think it might be a better idea to avoid embedding the ogg data in the elf executable, and instead only load ogg from theme.

Otherwise, that's 361kb of EE ram gone (even when loading other ogg files from themes).

@KrahJohlito
Copy link
Member Author

Hmm... I think it might be a better idea to avoid embedding the ogg data in the elf executable, and instead only load ogg from theme.

Otherwise, that's 361kb of EE ram gone (even when loading other ogg files from themes).

Alright what about: a customisable path entry in audio settings “Default Theme Music” users can set so we can still have BGM on default theme. “mass0:bgm.ogg” for example, Fair compromise or pointless option?

@uyjulian
Copy link
Member

uyjulian commented Dec 8, 2022

Hmm... I think it might be a better idea to avoid embedding the ogg data in the elf executable, and instead only load ogg from theme.
Otherwise, that's 361kb of EE ram gone (even when loading other ogg files from themes).

Alright what about: a customisable path entry in audio settings “Default Theme Music” users can set so we can still have BGM on default theme. “mass0:bgm.ogg” for example, Fair compromise or pointless option?

I guess that's fine

@KrahJohlito
Copy link
Member Author

Hmm... I think it might be a better idea to avoid embedding the ogg data in the elf executable, and instead only load ogg from theme.
Otherwise, that's 361kb of EE ram gone (even when loading other ogg files from themes).

Alright what about: a customisable path entry in audio settings “Default Theme Music” users can set so we can still have BGM on default theme. “mass0:bgm.ogg” for example, Fair compromise or pointless option?

I guess that's fine

Alright done and tested, if it meets approval I'll rebase the 2 new commits into the 2 old ones.

@KrahJohlito KrahJohlito requested review from uyjulian and removed request for rickgaiser December 9, 2022 00:29
Copy link
Member

@uyjulian uyjulian left a comment

Choose a reason for hiding this comment

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

Seems to be OK

@KrahJohlito
Copy link
Member Author

rebased

@uyjulian uyjulian merged commit be74f36 into ps2homebrew:master Dec 9, 2022
@INDRAPhilip
Copy link

INDRAPhilip commented Dec 11, 2022

@KrahJohlito It seems that this function can only run on the default opl screen if you try to use it in a custom theme in THM, the song will not continue to play, but opl thinks it does. Any ideas on how to fix it?

I have solved it, however, since this option is an optional thing it is not for the background music only plays if it is in the thm_temaX/sound folder where it has the effects sound initialization files would this be a limitation or difficulty to read files in different locations?

@KrahJohlito KrahJohlito deleted the ogg branch December 23, 2022 07:00
citronalco pushed a commit to citronalco/OPL-Daily-Builds that referenced this pull request Sep 10, 2023
Ogg vorbis supported theme background music
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants