Skip to content

Audio Handlers

detectBPM

WARNING

This function only works in browser.

  • description: Detect audio BPM(beats per minute).
  • returns: number of BPM
ts
import {  } from '@vincent-the-gamer/utils/client'

const : AudioBuffer // please convert you audio into AudioBuffer
const  = (() as any) * 1
.() // 120  (for example)

ncm2mp3

WARNING

This function only works in Node.js.

  • description: Transform .ncm audios into .mp3 audios.
  • inputs:
    • ncm directory
    • mp3 output directory
    • songcover output directory
  • outputs:
    • mp3 files
    • song covers
ts
import {  } from '@vincent-the-gamer/utils/server'

// just look if mp3 files have been generated.
await (
  'ncm',
  'mp3',
  'songcover'
)

Example

My GitHub Repo: Nemassler

Document by Vincent-the-gamer | MIT Licensed