Game Developer API
  • Introduction
  • Guidelines
  • Concepts
    • Game Load + Unload
    • Save + Load State
    • Start Game
    • Pause + Resume
    • Player Progress
    • Language + Translation
    • Text to Speech (TTS)
    • Audio
    • Questions + Answers
      • Question Overlay (V4)
      • Question List (V3)
  • Unity
    • Download SDK V5
    • API V5
      • Deprecated Behavior
    • Example Project
    • Project Requirements and Settings
    • Build and Run
    • Changelog
  • Javascript
    • JS API
      • Deprecated Behavior
  • Construct 3
  • Construct 2
  • Testing
  • Submission
  • ATTN: Note on Updating Games
Powered by GitBook
On this page

Was this helpful?

  1. Concepts

Audio

PreviousText to Speech (TTS)NextQuestions + Answers

Last updated 6 years ago

Was this helpful?

Legends of Learning has deprecated the audio interfaces we provided in the past.

Instead, developers should treat audio like any other concern, using vanilla JS or Javascript plugins as needed. We recommend (but do not require) for Audio. gives you greater control over sound, as well as reduce the level of complexity of working with cross-browser support of WebAudio. It can be loaded from a CDN or via a package manager like npm.

<script src="https://cdnjs.cloudflare.com/ajax/libs/howler/2.1.1/howler.min.js"></script>

General Javascript Organization

  • We suggest script tags after visible content and CSS, to make user-visible aspects load first

  • We suggest using the defer and async attributes of the script tag to make game rendering happen as early as possible. For more information see

For Unity games, it is also acceptable to handle audio within Unity's audio system. Keep in mind that audio in WebGL is handled differently and is more limited than other Unity platforms. For more information see .

For Javascript and Construct2 games, your game still needs to listen for state changes and adjust game sound accordingly.

Deprecated Methods

See or for implementation details.

  • PlaySound

  • StopSound

  • ConfigureSound

Howler.js
Howler.js
https://flaviocopes.com/javascript-async-defer/
https://docs.unity3d.com/2019.1/Documentation/Manual/webgl-audio.html
pause/resume
Javascript API
Unity API