Managing the Application Audio

Learn how the audio-player application's SoundManager service is implemented.

The SoundManager service

Now that we have covered the basics of the Web Audio API, let’s turn our attention to the SoundManager service for the application, as this will be responsible for managing the following:

  • Loading selected tracks
  • Setting up the audio context
  • Handling reverse playback of selected tracks
  • Enabling muting of volume
  • Stopping song playback
  • Changing volume and stereo balance
  • Returning duration of the track
  • Calculating current minutes and seconds of playback of the selected track

Amendments to the code

In the services/sound-manager.service.ts class, we make the following amendments (highlighted):

Get hands-on with 1200+ tech skills courses.