open-index/open-npm huggingface dataset:
npm package: @lavaclient/types
Description: Typings for lavalink.
Author: melike2d
Latest version: 2.1.1

<img src="https://i.imgur.com/LvsojLc.png" align="center">

> Type definitions for [Lavalink](https://github.com/freyacodes/lavalink)

<h2 align="center">Installation</h2>

**Node.js v16** or newer is required.

##### Stable

```shell
yarn add @lavaclient/types // npm install
```

##### Beta

```shell
yarn add @lavaclient/types@beta // npm install
```

##### Deno

1. From GitHub

```typescript
import { Filter } from "https://raw.githubusercontent.com/lavaclient/types/main/deno/v3.ts"
```

## Acknowledgements

- [**discordjs/discord-api-types**](https://github.com/discordjs/discord-api-types) - for the neat scripts and project structure

---

lavaclient © 2018 - 2022
npm package: @lavacoffee/datarw
Description: A binary data reader/writer aim to work with lavaplayer MessageIO
Author: azusfin
Latest version: 0.1.0

# @lavacoffee/datarw
> A binary data reader/writer aim to work with lavaplayer MessageIO

[![NPM Version](https://img.shields.io/npm/v/@lavacoffee/datarw.svg?maxAge=3600)](https://www.npmjs.com/package/@lavacoffee/datarw)
[![NPM Downloads](https://img.shields.io/npm/dt/@lavacoffee/datarw.svg?maxAge=3600)](https://www.npmjs.com/package/@lavacoffee/datarw)

## Documentation
https://lavacoffee.github.io/datarw

## Writer
```js
import { DataWriter } from "@lavacoffee/datarw"

const writer = new DataWriter()

// ... (more on docs)

const dataBytes = writer.finish()
```

## Reader
```js
import { DataReader } from "@lavacoffee/datarw"

const reader = new DataReader(dataBytes)

// ... (more on docs)
```
npm package: @lavacoffee/rest
Description: Lavalink rest handler for lavacoffee
Author: azusfin
Latest version: 0.1.0

# @lavacoffee/rest
> Lavalink rest handler for lavacoffee

[![NPM Version](https://img.shields.io/npm/v/@lavacoffee/rest.svg?maxAge=3600)](https://www.npmjs.com/package/@lavacoffee/rest)
[![NPM Downloads](https://img.shields.io/npm/dt/@lavacoffee/rest.svg?maxAge=3600)](https://www.npmjs.com/package/@lavacoffee/rest)

## Documentation
https://lavacoffee.github.io/rest
npm package: @lavacoffee/types
Description: A set of lavalink types
Author: azusfin
Latest version: 0.1.0

# @lavacoffee/types
> A set of lavalink types declaration for typescript

[![NPM Version](https://img.shields.io/npm/v/@lavacoffee/types.svg?maxAge=3600)](https://www.npmjs.com/package/@lavacoffee/types)
[![NPM Downloads](https://img.shields.io/npm/dt/@lavacoffee/types.svg?maxAge=3600)](https://www.npmjs.com/package/@lavacoffee/types)

## Documentation
https://lavacoffee.github.io/types
npm package: @lavacoffee/utils
Description: Utility tools to work for lavalink
Author: azusfin
Latest version: 0.1.0

# @lavacoffee/utils
> Utility tools to work for lavalink

[![NPM Version](https://img.shields.io/npm/v/@lavacoffee/utils.svg?maxAge=3600)](https://www.npmjs.com/package/@lavacoffee/utils)
[![NPM Downloads](https://img.shields.io/npm/dt/@lavacoffee/utils.svg?maxAge=3600)](https://www.npmjs.com/package/@lavacoffee/utils)

## Documentation
https://lavacoffee.github.io/utils

## Examples
- [Track](#track)
    - [Decode](#decode)
    - [Encode](#encode)
- [Filters](#filters)

### Track
#### Decode
Decode base64 encoded serialized track into track info
```js
import { Track } from "@lavacoffee/utils"

const track = Track.decode(rawTrack)
```

With additional details:
```js
import { Track } from "@lavacoffee/utils"

// Decode raw spotify track from spotify-plugin to track info
const track = Track.decode(rawTrack, (reader, sourceName) => {
    if (sourceName === "spotify") {
        return {
            isrc: reader.readNullableText(),
            artworkUrl: reader.readNullableText()
        }
    }
})
```

#### Encode
Encode track info into serialized track
```js
import { Track } from "@lavacoffee/utils"
import { fromByteArray } from "base64-js"

const serializedTrack = Track.encode(track)

// Encode into base64
const rawTrack = fromByteArray(serializedTrack)
```

With additional details:
```js
import { Track } from "@lavacoffee/utils"
import { fromByteArray } from "base64-js"

// Encode spotify track info to serialized spotify track
const serializedSpotifyTrack = Track.encode(track, (writer, track) => {
    if (track.sourceName === "spotify") {
        writer.writeNullableText(track.isrc)
        writer.writeNullableText(track.artworkUrl)
    }
})

// Encode into base64
const rawSpotifyTrack = fromByteArray(serializedSpotifyTrack)
```

### Filters
Filters builder
```js
import { FiltersBuilder } from "@lavacoffee/utils"

const filters = new FiltersBuilder()

// Set volume filter
filters.setVolume(1.5)

// Set equalizer filter
filters.equalizer
    .setBand(0, 0.25) // First band
    .setBand(14, -0.25) // Last band

// Enable karaoke filter
filters.karaoke.enable()

// Set timescale filter
filters.timescale
    .setSpeed(1.5) // Faster speed
    .setPitch(0.7) // Deeper pitch
    .setRate(0.9) // Slower playback rate

// Set tremolo filter
filters.tremolo
    .setFrequency(2) // Oscillate frequency
    .setDepth(0.5) // Oscillate depth

// Set vibrato filter
filters.vibrato
    .setFrequency(2) // Oscillate frequency
    .setDepth(0.5) // Oscillate depth

// Set rotation filter
filters.rotation
    .setRotationHz(5) // Rotation speed

// Enable distortion filter
filters.distortion.enable()

// Set channel mix filter
// Move all audio to right channel
filters.channelMix
    .setLeftToLeft(0)
    .setLeftToRight(1)
    .setRightToLeft(0)
    .setRightToRight(1)

// Enable lowpass filter
filters.lowPass.enable()

// Build the filters
const filtersObj = filters.build()
```