1.1.11 • Published 7 years ago

voiceLive v1.1.11

Weekly downloads
2
License
MIT
Repository
github
Last release
7 years ago

VoiceLive.js

Voice Live function library with Howler.js.

Installation

In a browser:

  <script src="voiceLive.js"></script>

Using npm:

  $ npm i -g npm
  $ npm i --save howler
  $ npm i --save voiceLive

Examples

img

  var datas = [{
    id: 4,
    src: 'xxxxx',
    time: 16,
    currentTime: 0
  }, {
    id: 4,
    src: 'xxxxx',
    time: 25,
    currentTime: 0
  }];

  var vl = new LiveAudio({
    datas: this.datas, 
    step: (itemId, currentTime, progress) => { // for live process, and like a timer 
      $('#currentTime-' + itemId).text(Math.floor(currentTime) + 's');
      $('#progress-' + itemId).text((progress * 100).toFixed(1) + '%')
    },
    events: { // events for current voice
      onload: function () {
        console.log('onload');
      },
      onloaderror: function () {
        console.log('onloaderror');
      },
      onplay: function () {
        console.log('onplay');
      },
      onpause: function () {
        console.log('onpause');
      },
      onstop: function () {
        console.log('onstop');
      },
      onend: function () {
        this.playNext(); // for auto play next item
        console.log('onend');
      }
    }
  });

Methods

  1. vl.play(id)

  2. vl.pause(id)

  3. vl.stop(id)

  4. vl.playNext()

  5. vl.playPre()

  6. vl.addVoice(data)

1.1.11

7 years ago

1.1.10

7 years ago

1.1.9

7 years ago

1.1.8

7 years ago

1.1.7

7 years ago

1.1.6

7 years ago

1.1.5

7 years ago

1.1.4

7 years ago

1.1.3

7 years ago

1.1.2

7 years ago

1.1.1

7 years ago

1.1.0

7 years ago

1.0.6

7 years ago

1.0.5

7 years ago

1.0.4

7 years ago

1.0.3

7 years ago

1.0.2

7 years ago

1.0.1

7 years ago