Proposal for v3.x: Improved sound system

Usually background music is streamed while “sound effects” are completely loaded in ram.

It is a very important design decision — sound effects need to be played in a low latency thread while background music can be played on a lower priority background thread.

This API design matches the hardware and OS services provided by the OS and will therefore remain the most effective implementation for CC2d-x in the foreseeable future.

It would be nice if there was some interface for dynamic generation of music … I’m thinking MIDI would be good for this.

callback after an effect ends.

*1 callbacks
*1 for crossfade background music items

*1 callbacks
*100 for crossfade background music items :smiley:

i would like to have some features:
preload/cached callback, just like Texture2D addImageAsync

and,
*1 background music queue,
*1 callbacks after end of effect

It would be handy if sounds could be triggered as Actions, to be called in a Sequence or Spawn.

Play multiple background musics.

Callback would be very nice. Let’s see after playing the sound effect is done add a callback function to do something else. Right now, I could not find a way to tell the length of the sound file and I hard code the time using cc.delaytime . but it does not work very well since the sound files have different length.

I couldn’t find any follow up to this discussion. Is this going to be part of 3.1?

This is a limitation that is hard to overcome. Compared to the cocos2d-x engine, its quality and the huge variety of things you can build from it, the sound system seems really left behind. 3.0 is such an improvement in general of the engine, that the sound system needs to be upgraded as well.

The community seem to be interested in the features proposed by ricardo. Have you planned something in this regard?

I too was going to make a comment as I don’t see any mention of major sound improvements in the roadmap. I was just waiting for 3.0 stable to be released as I’m sure the devs don’t want to get sidetracked until then. But since you brought it up, I figured I should mention that I also am very eagerly waiting to hear when the new audio system will be coming!

PS: devs: keep up the great work on 3.0, been loving it so far!

Yay 3.0 has been released!

Gratz to the devs on the awesome work!

Now it’s time to sit back, relax, and discuss the new sound system??

The new sound system should work for all platforms first.

  • Streaming mp3 etc for WinRT/WP8
  • Set volume works across platforms
  • Mem leaks addressed…

@IslandPlaya I agree getting features working on all platforms should be a priority, but I think the new sound system will be a re-write so I am not sure if spending time fixing the current system is worth it…

Still nothing in the roadmap about the new sound system?? I see a ton of amazing stuff planned for 3.1 and 3.2 that I am excited for… but still no mention at all of the new audio system (and sadly it is what I need the most).

Would be great to hear from the devs what the plan is…

For audio, I am using SDL_mixer on Windows since the SimpleAudioEngine implementation for it isn’t complete (for example, music volume change is not implemented).

@red wrote:

Would be great to hear from the devs what the plan is…

+1 :slight_smile:

  • Play sounds effects: …, many channels,

Many channels are necessary for coin collection sounds for example, when you collect a bunch of coins at once.

Is anyone working on this? If somebody can start a project on github, a lot of guys will contribute.

@smshuja

Brilliant idea!!

+9000

I am waiting for this also.