5

I have been doing some research on the best way to program a music game for iOS similar to Tap Tap Revenge, Guitar Hero, Rock Band etc. Portability is a plus.

This video explains that Open AL has some great ways of handling sounds, playing multiple sounds at once and recycling memory. I have also come across Cocoas2d Denshion for handling audio at low latency.

This article states that HTML5 is terrible for audio playback especially polyphony. He goes on to state that Phonegap's Media class works nicely and by using the native plugin model you can create a low latency solution with Phonegap

If you were to choose an API which would you choose to create a low latency audio based game and why? If you have a different suggestion than the ones mentioned please describe and why. Thank you.

KorinW
  • 279
  • 4
  • 10

4 Answers4

1

The RemoteIO Audio Unit, when configured with an Audio Session requesting very short buffers, will allow the lowest latencies on current iOS devices. OpenAL appears to be built on top of it.

hotpaw2
  • 70,107
  • 14
  • 90
  • 153
  • are there any threading challenges that arise when working directly with the time-constrained I/O audio unit? – KorinW Jun 04 '12 at 21:17
  • Both thread safety and real-time performance requirements. Those are the trade-offs required to get the lowest latency. – hotpaw2 Jun 04 '12 at 23:05
  • Another question... Do you think that trying to use Remote IO is overkill for a simple beat tapping game like Tap Tap Revenge, but instead of just tapping along to a song, you are actually triggering samples, or would using Cocos Denshion be okay for that purpose? – KorinW Jun 06 '12 at 05:19
  • Indeed, [OpenAL is at the _highest level_ of the audio api hierarchy](https://developer.apple.com/library/ios/documentation/MusicAudio/Conceptual/CoreAudioOverview/CoreAudioEssentials/CoreAudioEssentials.html) – bobobobo Dec 25 '13 at 02:15
0

There are ways to address HTML5 latency, as described here and here. I suggest you try those out on your phone and see if they feel responsive enough. If not, then Novocaine is probably your best bet.

Community
  • 1
  • 1
Yusuf X
  • 14,513
  • 5
  • 35
  • 47
0

If you should decide to go the PhoneGap route then Andy Trice's Low Latency Audio Plugin should address your concerns.

Simon MacDonald
  • 23,253
  • 5
  • 58
  • 74
0

Wedge.js is something I saw on Hacker News today, maybe it'll help you out

http://www.boxuk.com/labs/wedge-js

Mike
  • 2,633
  • 6
  • 31
  • 41