Game developers most likely agree that incorporating audio into HTML5 games can be a pain, which is why Zynga created Jukebox.
Jukebox, which Paul Bakaus first announced today at the New Game HTML5 conference in San Francisco, is a sprite-based sound manager for the web. Sound sprites enable the game developer to work with single sounds and subsequently avoid performance and latency issues.
"Doing audio in HTML5 is crazy hard -- like, trying-to-lick-your-elbow hard," CTO at Zynga Germany Paul Bakaus writes on the Zynga engineering blog. "Not a single codec supports all browsers and many browsers and devices come with huge performance bottlenecks when creating new instances of sounds. Then, there’s these weird limitations like on iOS: No multi-channel sound and playback must be activated through a user action (e.g. a touch event)."
LAUNCH has contacted Paul and will update this story if we receive a response.
The Jukebox features parallel playback and flash audio as fallback. It also constantly plays back silence to enable it to trigger sounds programmatically and eliminate the need for a user event to occur.
"Since the timer resolution of today's browsers, especially mobile ones, isn't great, it's important to leave a silence gap between every actual sound in the sprite," Paul writes on GitHub.
In October, Zynga launched its first three HTML5 games, which are featured on Facebook's Mobile Platform: Zynga Poker Mobile Web, FarmVille Express and Words with Friends HTML5, which includes an early development version of Jukebox.
Building games on HTML5 enables Zynga to reach gamers on mobile devices, as opposed to solely on social networks like Facebook or Google+. Previously, Zynga built the majority of their games using Adobe Flash.
"Overall, game development in HTML5 is so new that almost every aspect of design was a learning opportunity," Zynga Principal Software Engineer Amir Elaguizy wrote on the Zynga blog in October. "The team worked around bugs, built on previous experience and learned a lot through trial and error."
Zynga is expected to file its IPO this month with a valuation$20B. Zynga accounts for seven of Facebook's top 10 games and its game portfolio has 200M+ monthly active users, according to AppData.
CONTACTS & LINKS
Paul Bakaus, CTO at Zynga Germany