Are you using the Felgo sound items or the Qt-realted ones? And one more question, are you using the sound files from a resource file (qrc) or from the assets folder? Which file formats are you using?
You can also have a look at our demo games how we integrated sound effects and music into Felgo powered games.
I experienced that espescially the SoundEffect/SoundEffectVplay element is not working reliable on mobile devices. After some playtime, on Android some play() calls where ignored. On iOS this may also happen when the app gets focus again after staying in background. For me this looks like a memory/resources management issue. Now I switched to Audio that does not show that behavior.
For playing soundeffects I am using the standart Qt “Audio” element (include Qt.Multimedia), where also Backgroundmusic is derived from. Its disadvantage is, that it is to slow for immediately repeated play calls (i.e. shots). So at the moment I can not see any satisfying solution for playing soundeffects on all platforms.
for a recent project we were facing the same problem. The problem with the Audio element is not that it’s to “slow”, but if it is still playing (because the sound is too long), a play() call will not restart it, but gets ignored instead. We worked around it by using multiple Audio elements and toggle between them, so repetitive calls trigger different Audio elements. We modified the AudioManager from our FlappyBird demo game, to keep sound calls clean in the entities. Also don’t forget to check for settings.soundEnabled before playing the sound, since the Audio element is a standard Qt component.
I hope this works for you too.
Cheers,
Alex
This reply was modified 8 years, 6 months ago by Alex.
This reply was modified 8 years, 6 months ago by Alex.
Actually, it is a little bit of a trap for “young players” (not that I’m actually young).
The iPad has a little button at the top-right-rear, which is “Silence Ringer”. When you switch it, it says “Ringer Silent”.
Well…. unbeknown to me, that button silences the game sound as well as notifications.
I do recall switching that switch “on” when I first got the device, because at that time it was for my parents, and they didn’t want to be getting rings (they weren’t expecting any anyhow).
When I got no sound from my game, I tried other ways of getting sound: I went to YouTube for example. That still works even with the “silence” button on, which is why I thought it was the “game’s fault” that there was no sound.
The other day, I noticed that button again for some reason and a light bulb dinged on….
By signing up, you consent to Felgo processing your data & contacting you to fulfill your request. For more information on how we are committed to protecting & respecting your privacy, please review our privacy policy.
Want to find out if Felgo is a good fit for your company?
As part of the free Business evaluation, we offer a free welcome call for companies, to talk about your requirements, and how the Felgo SDK & Services can help you. Just sign up and schedule your call.
Sign up now to start your free Business evaluation: