Skip to content

Jak 2/3 - New Custom Audio Functions#165

Open
Nick0778 wants to merge 1 commit into
OpenGOAL-Mods:mainfrom
Nick0778:new-custom-audio-funcs
Open

Jak 2/3 - New Custom Audio Functions#165
Nick0778 wants to merge 1 commit into
OpenGOAL-Mods:mainfrom
Nick0778:new-custom-audio-funcs

Conversation

@Nick0778

Copy link
Copy Markdown
Contributor

This PR implements the following custom audio functions:

  • is-any-sound-playing?
  • is-sound-playing?
  • pause-all-sounds
  • resume-all-sounds

I also made changes to main, default-menu and scene, to automatically pause and resume any custom audio when opening or closing the Progress Menu, the Debug Menu, or the Popup Menu, as well as during cutscenes.

Example of usage:

(when (not (is-any-sound-playing?))
   (play-sound-file "TORN010.wav" (the int (* (-> *setting-control* user-default dialog-volume) 100.0)))
   )
(when (not (is-sound-playing? "TORN010.wav"))
   (play-sound-file "TORN010.wav" (the int (* (-> *setting-control* user-default dialog-volume) 100.0)))
   )
(when (is-any-sound-playing?)
   (pause-all-sounds)
   )

added:

`is-any-sound-playing?`;
`is-sound-playing?`;
`pause-all-sounds`;
`resume-all-sounds`
@Zedb0T

Zedb0T commented Jun 19, 2026

Copy link
Copy Markdown
Contributor

You would need to scope these changes, being able to play custom audio during the progress menu or cutscenes is a feature that is used in mods like Jak the chicken for custom cutscenes and Mario legacy for pause/title menu music

@Nick0778

Copy link
Copy Markdown
Contributor Author

You would need to scope these changes, being able to play custom audio during the progress menu or cutscenes is a feature that is used in mods like Jak the chicken for custom cutscenes and Mario legacy for pause/title menu music

So, would you recommend that I remove these changes from the engine code to allow people to do those kinds of things in their mods?

@Nick0778

Nick0778 commented Jun 21, 2026

Copy link
Copy Markdown
Contributor Author

Actually, the changes in scene are meant to stop custom audio when a cutscene ends (the problem is that I made it stop all custom audios) in case there's any custom audio playing during the cutscene for voice acting or anything else. They also allow the cutscene to be paused in Debug Mode by pressing X, and completely stop the custom audio when speeding up or slowing down the cutscene, since I haven't implemented a system to handle that with custom audio.

But yeah, if it's better to remove these changes, I can do that.

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.

2 participants