11-20-2012 06:57 PM
Hello!
I am using the MediaPlayer object in QML.
Problem: If I have 10 objects, and when you tap an object a sound plays... then with ONE MediaPlayer, the sound that is playing has to finish before another sound can start. (Or you can write the code to 'stop the existing sound and play another one'). Either way, you can't have a musical flurry when you tap each object.
Current Solution: Add a MediaPlayer component to each object, so when you tap that object, it plays its own MediaPlayer. Sounds amazing because the sounds overlap. In a game, if you are hitting objects quicker than their sound can play, this sounds great as the dings/boops/pings are nicely overlapping as they sound.
However I feel that this might be taking up unnecessary memory? For example if I had 100 objects, I don't think I'd want 100 MediaPlayer components attached?
Is there a better way to do concurrent sound in QML?
Solved! Go to Solution.
11-20-2012 09:23 PM - edited 11-20-2012 09:29 PM
Check this. They used multiple simultaneous sounds with only one soundmanger.
https://github.com/blackberry/Presentations/tree/m
11-21-2012 06:38 PM
Awesome. Thanks. I have implemented this.
I have a question about the destructor and app cleanup, but I've started a new (more relevant) thread for that: