Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Beginning Android Games - Audio API

 
Tibor Nagy
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Mr Zechner,

Using audio in games is very important. Most of the systems handling multiple sounds at the same time (background music, different sound effects) is very hard. In Android it is also a difficult task or the API help to solve it?
 
Mario Zechner
author
Ranch Hand
Posts: 47
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It's actually very simple, the two main classes you want to use are called MediaPlayer and SoundPool. The later lets you playback multiple sound effects simultaniously. There are also classes to record audio from the microphone and playback PCM samples directly. Be warned however, Android has a big issue with audio latency (the time span from issueing the command to play a sound effect and the actual playback starting).
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic