New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

voice-live

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

voice-live

live audio

latest
rename all file
Source
npmnpm
Version
1.1.12
Version published
Maintainers
1
Created
Source

VoiceLive.js

Voice Live function library with Howler.js.

Installation

In a browser:

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

Using npm:

  $ npm i -S howler
  $ npm i -S 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: function (itemId, currentTime, progress) { // for live process, and like a timer 
      progress = (progress * 100).toFixed(2) // for to 100
      if (progress > 99) {
        progress = 100.00
      }
      $('#currentTime-' + itemId).text(Math.floor(currentTime) + 's');
      $('#progress-' + itemId).text(progress + '%')
    },
    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

  • vl.play(id)

  • vl.pause(id)

  • vl.stop(id)

  • vl.seek(id, time)

  • vl.playNext()

  • vl.playPre()

  • vl.addVoice(data)

  • vl.destory([id][,fn])

  • vl.replaceVoice(id, src)

Keywords

voice

FAQs

Package last updated on 27 Mar 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts