V-Play has a new name, say hi to Felgo!Learn More

AudioManager.qml Example File

demos/FlappyBird/qml/common/AudioManager.qml
 import Felgo 3.0
 import QtQuick 2.0

 Item {
   id: audioManager

   // Use Sound IDs to play Sounds e.g. audioManager.play(audioManager.idDIE)
   property int idDIE: 11
   property int idHIT: 22
   property int idPOINT: 33
   property int idSWOOSHING: 44
   property int idWING: 55

   function play(clipID) {

     switch(clipID) {
     case idDIE:
       die.play()
       break
     case idHIT:
       hit.play()
       break
     case idPOINT:
       point.play()
       break
     case idSWOOSHING:
       swoosh.play()
       break
     case idWING:
       wing.play()
       break
     }
   }

   SoundEffect {
     id: die
     source: "../../assets/audio/sfx_die.wav"
   }
   SoundEffect {
     id: hit
     source: "../../assets/audio/sfx_hit.wav"
   }
   SoundEffect {
     id: point
     source: "../../assets/audio/sfx_point.wav"
   }
   SoundEffect {
     id: swoosh
     source: "../../assets/audio/sfx_swooshing.wav"
   }
   SoundEffect {
     id: wing
     source: "../../assets/audio/sfx_wing.wav"
   }
 }

Voted #1 for:

  • Easiest to learn
  • Most time saving
  • Best support

Develop Cross-Platform Apps and Games 50% Faster!

  • Voted the best supported, most time-saving and easiest to learn cross-platform development tool
  • Based on the Qt framework, with native performance and appearance on all platforms including iOS and Android
  • Offers a variety of plugins to monetize, analyze and engage users
FREE!
create apps
create games
cross platform
native performance
3rd party services
game network
multiplayer
level editor
easiest to learn
biggest time saving
best support