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

In-Game: Add a new function to easily set audio panning values #8712

Closed
ShadowTheDragon opened this issue Dec 16, 2024 · 2 comments
Closed
Labels
feature request New feature (or a request for one)

Comments

@ShadowTheDragon
Copy link

Is your feature request related to a problem?

It is not really a massive issue so much as it makes more complex audio stuff frustrating with GameMaker. I want to make a horror game in GameMaker and I want to be able to simply play audio through only the left or right speakers to communicate information better to the player. But it's frustrating because all the solutions are overcomplicated (adding 3 versions of the same sound with different panning for each) or overkill for simple audio panning (directional audio).

Describe the solution you'd like

I would like it so that, in code, you can simply set the speaker (left, right, both) the audio will play through through during runtime.
To clarify, I mean a way to dynamically change/set the panning of played audio (like how you can, in Audacity for example, pan the audio entirely to the left or entirely to the right.)

An example of what I mean is: On headphones (or computer/laptop speakers), I'd like it so you could, for example, set it so audio will either play on both speakers, left speaker only, or right speaker only (with the default being both, aka how GameMaker works normally). Right now, the only way I can see to do this in-engine is to add the same sound 3 times into a project (with the audio panned to the left, right, or not at all) for every sound.

I would like it to work like how you can write "draw_set_halign" before using "draw_text" to make the drawn text have a different alignment then afterwards using "draw_set_halign" to change it back to how it was so new text after that doesnt have the new alignment.
Something like, "audio_set_speaker" or something using a number variable (-1 for left, 0 for center, 1 for right) (could also add a optional argument to specify if you want it to apply to a different audio bus than the main one or with different audio groups like how audio groups can each have their own gain level). I'd also like it if this doesn't affect previously playing audio (like how setting the halign doesn't change text drawn before with a different alignment having already been set for it). I would really prefer this to work with audio_play_sound.

I know directional audio is already a thing in GameMaker, but im asking for it to be possible to set the panning of sounds to played out of just one speaker (on either side) or both.

Describe alternatives you've considered

No response

Additional context

This is just a effectively tl;dr screenshot of what specifically I mean in my suggestion.
Image

@ShadowTheDragon ShadowTheDragon added the feature request New feature (or a request for one) label Dec 16, 2024
@ShadowTheDragon
Copy link
Author

ShadowTheDragon commented Dec 16, 2024

I forgot to change "audio_set_speaker" to be something more accurate to what it actually is. "Audio_set_pan" would be a lot more fitting. You could also add "pan" as an optional argument in audio_play_sound and its equivalents, that would probably be a lot easier tbh and work just as well!

This would be very useful and I'm sure a good number of people would be thankfully to have easier audio panning.

@ShadowTheDragon ShadowTheDragon changed the title The ability to set how audio plays through speakers so it will play from either both, left only, or right only. The ability to easily set audio panning without the current hacky workarounds. Dec 16, 2024
@toby-yoyo
Copy link

Duplicate of #6075

@toby-yoyo toby-yoyo marked this as a duplicate of #6075 Dec 17, 2024
@YYDan YYDan changed the title The ability to easily set audio panning without the current hacky workarounds. In-Game: Add a new function to easily set audio panning values Dec 17, 2024
@stuckie stuckie closed this as completed Dec 17, 2024
@github-project-automation github-project-automation bot moved this from Triage to Done in Team Workload Dec 17, 2024
@gurpreetsinghmatharoo gurpreetsinghmatharoo moved this from Done to Not a bug in Team Workload Dec 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request New feature (or a request for one)
Projects
Status: Not a bug
Development

No branches or pull requests

3 participants