# ncm-audio-recognize

Latest version **1.4.0** (published 2025-11-20) · ISC license · 0 weekly downloads

## Install

```sh
npm install ncm-audio-recognize
pnpm add ncm-audio-recognize
yarn add ncm-audio-recognize
bun add ncm-audio-recognize
```

## Health

**Score 45/100 (D)** — status: stable.

Positive: has types; esm support; no vulnerabilities.

Warnings: low downloads.

Negative: insecure dependencies.

## Facts

| | |
|---|---|
| Version | 1.4.0 |
| Published | 2025-11-20 |
| First published | 2023-10-24 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 2 |
| Unpacked size | 317.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 48 |
| Author | Aki Nazuki |
| Maintainers | aki_natsuki |

## Links

- npm: https://www.npmjs.com/package/ncm-audio-recognize
- Repository: https://github.com/akinazuki/NeteaseCloudMusic-Audio-Recgonize
- Homepage: https://github.com/akinazuki/NeteaseCloudMusic-Audio-Recgonize#readme
- Issues: https://github.com/akinazuki/NeteaseCloudMusic-Audio-Recgonize/issues
- npm.io page: https://npm.io/package/ncm-audio-recognize

## Dependencies (2)

- [web-audio-api](https://npm.io/package/web-audio-api.md) github:audiojs/web-audio-api
- [web-audio-api-cjs](https://npm.io/package/web-audio-api-cjs.md) ^0.2.4

## Recent versions

- 1.4.0 (latest) — 2025-11-20
- 1.3.0 — 2023-10-25
- 1.2.0 — 2023-10-25
- 1.1.0 — 2023-10-24
- 1.0.0 — 2023-10-24

## README

# NeteaseCloudMusic-Audio-Recognize

## Usage

```shell
$ npm install ncm-audio-recognize
$ node test.js samples/Komplexe.mp3
Module loading: /Users/natsuki/workspace/ncm-audio-recognize/afp.wasm
Module loaded: [object WebAssembly.Instance]
Encoded Data:  W5/Hd3yYCY2E....
[1] Komplexe - 雄之助 Album: 「maimai でらっくす ベストアルバムちほー」 CID: [1914659931]
```

## Example Code
```javascript
import ncmutils from 'ncm-audio-recognize'
import fs from 'fs'

const buffer = fs.readFileSync("./takenohana.mp3")
const encoded = await ncmutils.encode(buffer)
const result = await ncmutils.recognize(encoded)
console.log(`Matched result count: ${result.length}`)
result.forEach((item, index) => {
    console.log(`[${index + 1}] ${item.song.name} - ${item.song.artists.map(artist => artist.name).join('/')} Album: 「${item.song.album.name}」 CID: [${item.song.id}]`)
})
```


## Documentation

### ```encode(fileBuffer)```

Params| Type |Description|
|-------|-------|-------|
```fileBuffer``` | `Buffer` | The audio file data.

Returns: `string` The encoded data.

---

### ```recognize(encodedData)```

Params| Type |Description|
|-------|-------|-------|
```encodedData``` | `string` | The encoded data.

Returns: `Array` The matched result.

---

### ```rawEncode(audiodata, from, len, channel)```

Params| Type |Description|
|-------|-------|-------|
```audioContextData``` | `AudioBuffer` | The audio data. 
```from``` | `number` | The time when the audio data started
```len``` | `number` | The secs of the audio data.
```channel``` | `number` | The channel of the audio data.

Returns: `string` The encoded data.

## Credits

[MicroCBer/BeatSaverSongData](https://github.com/MicroCBer/BeatSaverSongData)

---
_Source: https://npm.io/package/ncm-audio-recognize · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
