jecho - An easy-to-use js audio library

API Docs for: 0.0.1
Module jecho

Class jecho

The main library module.

Properties

Object

drivers

The vailable drivers for the audio management.

Fields

  • UNBUFFERED String
  • BUFFERED String
Object

events

Contains all the event types that can be fired in jecho.

Fields

  • LOAD String
  • LOAD_PROGRESS String
  • PAN_CHANGED String
  • PITCH_CHANGED String
  • VOLUME_CHANGED String
  • POSITION_CHANGED String
  • DURATION_AVAILABLE String

Method summary

static String

formatTime

(
  • seconds: Integer
  • format: String
)

Convert the given number of seconds into a readable time format.

static void

load

(
  • src: String
)

Load an audio file

Methods

static String

formatTime

(
  • seconds: Integer
  • format: String
)

Convert the given number of seconds into a readable time format.

Parameters

  • seconds Integer
  • format String

    The format to use

    • h will be replaced by the number of hours
    • m will be replaced by the number of minutes
    • s will be replaced by the number of seconds
    Default is 'm:s'.

Returns

A string representation of the time

Example

var time = 4*60*60 + 25*60 + 11;
var timeStr = jecho.formatTime(time,'h:m:s');
console.log(timeStr);
// "04:25:11"
static void

load

(
  • src: String
)

Load an audio file

Parameters

  • src String

    The audio source filename / URL