YoYoGames / GameMaker-Bugs

Public tracking for GameMaker bugs
24 stars 8 forks source link

In-Game: Function to make 2d and 3d audio(played without an emitter using audio_play_sound_at) use a specified bus #4227

Open iampremo opened 1 year ago

iampremo commented 1 year ago

Ticket #206474

Feature Type: feat_addition_ingame Description: Basically, the only way to use custom buses with the new audio effects is to have them come out of emitters. However, I know that in a general sense, 2d and 3d sounds(without an emitter using audio_play_sound_at()) CAN support being sent to buses since they go through the main bus and therefore can have effects applied.

My suggestion is to have a function that you would call, maybe audio_set_current_bus(bus) that would make all sounds being played(except ones on an emitter) go through the custom bus you specify, or back on the main bus as needed. This would allow us to not have to "emulate" 2d sound by forcing sounds to come out of emitters when they really shouldn't be needed just to make audio come out of a custom bus. Benefit: Right now the only options for using audio effects are to apply them to ALL sounds, or to use a custom bus with audio only coming out of emitters. Making the change would allow us to have 2d sounds(and 3d sounds without an emitter) also come out of custom buses. Right now, to make things work, I will have to create an emitter for any 2d sounds(and then have that emitter follow the listener), and for one-off 3d sounds that don't really need an emitter I will have to create an emitter, just to get to use audio effects for only a group of sounds. This is kind of a sucky workaround to be honest. Link: Nothing to review.

kburkhart84 commented 1 year ago

Hey, I found my suggestion!!!!!!!

I think I pretty much explained it right there already. I think this one could go right along with the one about routing buses ourselves. Feel free to ask any questions if something wasn't understood about what I'm wanting.

Gamer-XP commented 10 months ago

Encountered similar limitation. Basically, I want to apply some reverb effects on all normal sounds based on current room, but this will also make it apply reverb to the music playing. To avoid it, I need to use emitter with custom bus and play all sounds with it, but I use 3D sounds, so I need an emitter for each sound I play.. this will be a mess since emitters do not auto-destuct when they end playing.

What I'd like is either:

  1. A function to specify which bus will be used to play given audio. Audio can be either asset or audio instance. May accept "all" to set bus for all assets at the same time. This way I can set one bus for all normal sounds, another for music, maybe third for things that should not be affected by effects.
  2. Extra audio play function or and extra argument to existing ones to specify bus used to play it.