Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: Multiple audio channels that can be individually managed  (Read 13122 times)

0 Members and 2 Guests are viewing this topic.

nulloid

  • Full Member
  • ***
  • Posts: 134
    • View Profile
Multiple audio channels that can be individually managed
« Reply #15 on: April 23, 2010, 10:09:24 pm »
Quote from: "Laurent"
Ok I see. That looks very interesting, don't hesitate to post in the "projects" forum when you have something to show :)


Well, of course, I will :) But don't hold your breath, I have a lot of entries on the to-do side... :)

Quote from: "Laurent"
I think that the workaround involving the 3D position of the audio sources is the only solution with the current API (and probably with OpenAL).


Absolutely. On the other hand, I had time to think about it. If OpenGL lacks per-pixel operations (it does, right?), than maybe it's not a big deal if we can't manipulate channels separately from each other, cause it is not in the scope of OpenAL... what is your opinion? Or what do you think about this whole "use-individual-channels-without-sending-nulldata-to-the-other-channels" thing?

Cyrano

  • Newbie
  • *
  • Posts: 19
    • View Profile
Multiple audio channels that can be individually managed
« Reply #16 on: April 24, 2010, 05:54:25 am »
I think a graphic representation of my situation is in order:

-------------------------------------------------------------------------------------

Engine/resources
 |
\/
Channels 1-5
 |
\/
---1---2---3--4---5
--|--||--||--||--||--|
--|--||--||--||--||--|
--|--||--||--||--||X|
--|-s||--||--||--||--|----sounds are organized by "channels".
--|--||--||--||--||--|
--|--||--||--||--||--|
--\--\\--\|--|/--//--/
---\--\\--------//--/-----mixed together
-----\------------/
-----|----------|-------To output.
-----|----------|
-----|----------|
----------||
----------\/
-------speakers

-------------------------------------------------------------------------------------

This shows that a "channel" can be dealt with individually. Let's say channel 5 had all enemy characters' dialogue playing through it. I could mute it (the "X") and not affect any other sounds.

The benefit here is that I don't have to hunt down every sound belonging to that group, just to mute them. I can simply trigger the mute feature for the channel, and it accomplishes the same effect.

Other things, such as volume control would also be possible.

Since I highly doubt such a system exists, I expect I'll have to build this myself.

Happy coding!

-Cyrano
– A cape? Forsooth! 'Tis a peninsula!

Ashenwraith

  • Sr. Member
  • ****
  • Posts: 270
    • View Profile
Multiple audio channels that can be individually managed
« Reply #17 on: April 24, 2010, 08:39:33 am »
This isn't a snes emulator, you don't work low level with the sound channels.

You have a 3D sound API that has many techniques to manage spatial sound and mix.

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Multiple audio channels that can be individually managed
« Reply #18 on: April 24, 2010, 10:26:38 am »
So you don't really want to manage output channels (speakers) separately, you just want to be able to manage "groups" of sounds and assign them properties in a single operation on the group?

This isn't hard to implement, you just need to create a SoundChannel class which is a container of sf::Sound instances, and provide the functions that you want (SetVolume, SetPitch, ...) that just forward the calls to the contained sounds.
Laurent Gomila - SFML developer

Cyrano

  • Newbie
  • *
  • Posts: 19
    • View Profile
Multiple audio channels that can be individually managed
« Reply #19 on: May 09, 2010, 09:11:09 pm »
Quote from: "Laurent"
So you don't really want to manage output channels (speakers) separately, you just want to be able to manage "groups" of sounds and assign them properties in a single operation on the group?

This isn't hard to implement, you just need to create a SoundChannel class which is a container of sf::Sound instances, and provide the functions that you want (SetVolume, SetPitch, ...) that just forward the calls to the contained sounds.


Bingo!

That should work. Thanks.
– A cape? Forsooth! 'Tis a peninsula!