How i can play several background musics?


#1

Hello, i began use cocos2d music engine, but i see some limitation. How i can realize next features:

  • Playback several music file in the same time. Adjust volume of each music file.
  • Loop music file from a certain time. For example: loop background music since 5 second.

#2

AFAIK, playing more than 1 background music is not possible at this time with bare cocos. If you are targeting only iOS you can write a wrapper to AVAudioPlayer which provides this functionality. I don’t know if Android can play several audio files as background music, but if it can, then this would be achievable via JNI calls.


#3

Pawel Lopusinski wrote:

AFAIK, playing more than 1 background music is not possible at this time with bare cocos. If you are targeting only iOS you can write a wrapper to AVAudioPlayer which provides this functionality. I don’t know if Android can play several audio files as background music, but if it can, then this would be achievable via JNI calls.

Is exists wrappers such as SimpleMusic but for my tasks?


#4

Is playing more than one background music needed?
If it is a common requirement, then we will implement it.


#5

Minggo Zhang wrote:

Is playing more than one background music needed?
If it is a common requirement, then we will implement it.
Yes it’s common requirement. Second requirement is desirable, but it’s can be implemented by other way. When you’ll plan to implement more then one background music?


#6

We can implement it. But it is not an high priority issue.


#7

We can implement it. But it is not a high priority issue.


#8

And #2468 is created for it.


#9

Minggo Zhang wrote:

And #2468 is created for it.

Hi! Can you guys implement starting a song file from a certain point? If you can pause and resume, maybe this is not that hard. :slight_smile:


#10

Sergey Volkov wrote:

Hello, i began use cocos2d music engine, but i see some limitation. How i can realize next features:
>
* Playback several music file in the same time. Adjust volume of each music file.
* Loop music file from a certain time. For example: loop background music since 5 second.

you can try this:
http://www.shlzero.com/wordpress/?page_id=205

bye


#11

Minggo Zhang wrote:

We can implement it. But it is not a high priority issue.

Thank you very much, I have a problem using more than one backgroundmusic in a row. Between one file and other, a little pause happen, and I cannot optimize the music as I want.