1.0.9 • Published 7 months ago

music-lyric-utilities v1.0.9

Weekly downloads
-
License
MIT
Repository
github
Last release
7 months ago

music-lyric-utilities

A Lyric Utils

Installation

  • Npm Install
npm install music-lyric-utilities
  • Script Link
<script src="./music-lyric-utilities.iife.js"></script>

Use

  • Node
import { Parser, Player } from 'music-lyric-utilities'

// parser
const lyricParser = new Parser.LyricParser()

// parser info
const lyricInfo = lyricParser.parse({
  original: '',
  translated: '',
  roman: '',
  dynamic: '',
})

// player
const lyricPlayer = new Player.LyricPlayer({
  onSetLyric(info) {
    console.log('onSetLyric', info)
  },
  onLinePlay(lineNum, info) {
    console.log('onLinePlay', lineNum, info)
  },
})

// update lyric
lyricPlayer.updateLyric(lyricInfo)

// play lyric
lyricPlayer.play(0)
  • Web
<script>
  const { LyricParser, LyricPlayer } = MusicLyricUtilities

  const lyricParser = new LyricParser()
  const lyricInfo = lyricParser.parse({
    original: '',
    translated: '',
    roman: '',
    dynamic: '',
  })

  const player = new LyricPlayer({
    onSetLyric(info) {
      console.log('onSetLyric', info)
    },
    onLinePlay(lineNum, info) {
      console.log('onLinePlay', lineNum, info)
    },
  })
  player.updateLyric(lyricInfo)

  player.play(0)
</script>

LICENSE

MIT

1.0.9

7 months ago

1.0.8

7 months ago

1.0.7

7 months ago

1.0.6

7 months ago

1.0.5

8 months ago

1.0.4

8 months ago

1.0.3

8 months ago

1.0.2

8 months ago

1.0.1

8 months ago

1.0.0

8 months ago