# Interface: AudioChannelInterface (/jsdoc/pixi-vn/index/interfaces/AudioChannelInterface)



Defined in: [src/sound/interfaces/AudioChannelInterface.ts:5](https://github.com/DRincs-Productions/pixi-vn/blob/4b8909bd13b1cc1fa7efb0238c44a5af3767e61f/src/sound/interfaces/AudioChannelInterface.ts#L5)

## Properties [#properties]

### alias [#alias]

\> `readonly` **alias**: `string`

Defined in: [src/sound/interfaces/AudioChannelInterface.ts:9](https://github.com/DRincs-Productions/pixi-vn/blob/4b8909bd13b1cc1fa7efb0238c44a5af3767e61f/src/sound/interfaces/AudioChannelInterface.ts#L9)

The alias of the audio channel. This is used to reference the channel when playing sounds. The alias must be unique among all channels.

***

### background [#background]

\> `readonly` **background**: `boolean`

Defined in: [src/sound/interfaces/AudioChannelInterface.ts:54](https://github.com/DRincs-Productions/pixi-vn/blob/4b8909bd13b1cc1fa7efb0238c44a5af3767e61f/src/sound/interfaces/AudioChannelInterface.ts#L54)

Whether this channel is a background channel.
Background channels are special channels. Unlike normal channels, media connected to a background channel does not stop when a scene changes, but continues to play in the background.

***

### mediaInstances [#mediainstances]

\> `readonly` **mediaInstances**: [`MediaInterface`](/jsdoc/pixi-vn/index/interfaces/MediaInterface)\[]

Defined in: [src/sound/interfaces/AudioChannelInterface.ts:49](https://github.com/DRincs-Productions/pixi-vn/blob/4b8909bd13b1cc1fa7efb0238c44a5af3767e61f/src/sound/interfaces/AudioChannelInterface.ts#L49)

The MediaInstances currently playing through this channel. This is read-only and cannot be modified directly. Use the play method to add new MediaInstances to this channel.

***

### muted [#muted]

\> **muted**: `boolean`

Defined in: [src/sound/interfaces/AudioChannelInterface.ts:45](https://github.com/DRincs-Productions/pixi-vn/blob/4b8909bd13b1cc1fa7efb0238c44a5af3767e61f/src/sound/interfaces/AudioChannelInterface.ts#L45)

Whether the audio channel is muted. This is combined with the muted state of each sound played through this channel.

***

### pan [#pan]

\> **pan**: `number`

Defined in: [src/sound/interfaces/AudioChannelInterface.ts:37](https://github.com/DRincs-Productions/pixi-vn/blob/4b8909bd13b1cc1fa7efb0238c44a5af3767e61f/src/sound/interfaces/AudioChannelInterface.ts#L37)

The stereo pan position for this channel in the range \[-1, 1].
-1 is full left, 0 is centre, 1 is full right.

***

### panParam [#panparam]

\> `readonly` **panParam**: `Param`\<`"audioRange"`>

Defined in: [src/sound/interfaces/AudioChannelInterface.ts:141](https://github.com/DRincs-Productions/pixi-vn/blob/4b8909bd13b1cc1fa7efb0238c44a5af3767e61f/src/sound/interfaces/AudioChannelInterface.ts#L141)

**Advanced** — the raw `Tone.Param<"audioRange">` for this channel's
stereo pan position.

Unlike the [pan](#pan) property (which sets the value instantly), this
Param exposes all Tone.js automation methods such as `rampTo`,
`linearRampTo`, and `exponentialRampTo`.

Use this when you need to smoothly automate panning over time instead of
setting it instantly.  Values range from -1 (full left) to 1 (full right).

#### Example [#example]

```ts
const channel = sound.channels.find("music");

// Gradually pan to the left over 3 seconds.
channel.panParam.rampTo(-1, 3);

// Return to centre over 2 seconds.
channel.panParam.rampTo(0, 2);
```

***

### volume [#volume]

\> **volume**: `number`

Defined in: [src/sound/interfaces/AudioChannelInterface.ts:41](https://github.com/DRincs-Productions/pixi-vn/blob/4b8909bd13b1cc1fa7efb0238c44a5af3767e61f/src/sound/interfaces/AudioChannelInterface.ts#L41)

The volume of the audio channel, between 0 and 1. This is multiplied with the volume of each sound played through this channel.

***

### volumeParam [#volumeparam]

\> `readonly` **volumeParam**: `Param`\<`"decibels"`>

Defined in: [src/sound/interfaces/AudioChannelInterface.ts:118](https://github.com/DRincs-Productions/pixi-vn/blob/4b8909bd13b1cc1fa7efb0238c44a5af3767e61f/src/sound/interfaces/AudioChannelInterface.ts#L118)

**Advanced** — the raw `Tone.Param<"decibels">` for this channel's volume.

Unlike the [volume](#volume) property (which uses a linear 0–1 scale), this
Param works directly in **decibels** and exposes all Tone.js automation
methods such as `rampTo`, `linearRampTo`, and `exponentialRampTo`.

Use this when you need to smoothly automate volume over time instead of
setting it instantly.

#### Example [#example-1]

```ts
const channel = sound.channels.find("music");

// Fade the volume from its current level to -12 dB over 3 seconds.
channel.volumeParam.rampTo(-12, 3);

// Fade to silence over 2 seconds.
channel.volumeParam.rampTo(-Infinity, 2);
```

## Methods [#methods]

### chain() [#chain]

\> **chain**(...`nodes`): `this`

Defined in: [src/sound/interfaces/AudioChannelInterface.ts:96](https://github.com/DRincs-Productions/pixi-vn/blob/4b8909bd13b1cc1fa7efb0238c44a5af3767e61f/src/sound/interfaces/AudioChannelInterface.ts#L96)

Useful for inserting channel-wide audio effects such as reverb, delay or EQ.

Install "tone" to use this method.

#### Parameters [#parameters]

##### nodes [#nodes]

...`ToneAudioNode`\<`ToneWithContextOptions`>\[]

One or more Tone.js ToneAudioNode instances to chain in series.

#### Returns [#returns]

`this`

Instance for chaining.

#### Example [#example-2]

```ts
import * as Tone from "tone";

const channel = sound.channels.find("music");

// Create a reverb effect and wait for its impulse response to be ready.
const reverb = new Tone.Reverb({ decay: 2.5 });

// Route the channel through the reverb to the master output.
channel.chain(reverb);
```

***

### pauseAll() [#pauseall]

\> **pauseAll**(): `this`

Defined in: [src/sound/interfaces/AudioChannelInterface.ts:64](https://github.com/DRincs-Productions/pixi-vn/blob/4b8909bd13b1cc1fa7efb0238c44a5af3767e61f/src/sound/interfaces/AudioChannelInterface.ts#L64)

Pauses any playing sounds.

#### Returns [#returns-1]

`this`

Instance for chaining.

***

### play() [#play]

#### Call Signature [#call-signature]

\> **play**(`alias`, `options?`): `Promise`\<[`MediaInterface`](/jsdoc/pixi-vn/index/interfaces/MediaInterface)>

Defined in: [src/sound/interfaces/AudioChannelInterface.ts:18](https://github.com/DRincs-Productions/pixi-vn/blob/4b8909bd13b1cc1fa7efb0238c44a5af3767e61f/src/sound/interfaces/AudioChannelInterface.ts#L18)

Plays a sound.

##### Parameters [#parameters-1]

###### alias [#alias-1]

`string`

The media and sound (asset) alias reference.

###### options? [#options]

[`SoundPlayOptions`](/jsdoc/pixi-vn/index/interfaces/SoundPlayOptions)

The options

##### Returns [#returns-2]

`Promise`\<[`MediaInterface`](/jsdoc/pixi-vn/index/interfaces/MediaInterface)>

The sound instance,
this cannot be reused after it is done playing. Returns a Promise if the sound
has not yet loaded.

#### Call Signature [#call-signature-1]

\> **play**(`mediaAlias`, `soundAlias`, `options?`): `Promise`\<[`MediaInterface`](/jsdoc/pixi-vn/index/interfaces/MediaInterface)>

Defined in: [src/sound/interfaces/AudioChannelInterface.ts:28](https://github.com/DRincs-Productions/pixi-vn/blob/4b8909bd13b1cc1fa7efb0238c44a5af3767e61f/src/sound/interfaces/AudioChannelInterface.ts#L28)

Plays a sound.

##### Parameters [#parameters-2]

###### mediaAlias [#mediaalias]

`string`

The media alias reference.

###### soundAlias [#soundalias]

`string`

The sound (asset) alias reference.

###### options? [#options-1]

[`SoundPlayOptions`](/jsdoc/pixi-vn/index/interfaces/SoundPlayOptions)

The options

##### Returns [#returns-3]

`Promise`\<[`MediaInterface`](/jsdoc/pixi-vn/index/interfaces/MediaInterface)>

The sound instance,
this cannot be reused after it is done playing. Returns a Promise if the sound
has not yet loaded.

***

### resumeAll() [#resumeall]

\> **resumeAll**(): `this`

Defined in: [src/sound/interfaces/AudioChannelInterface.ts:69](https://github.com/DRincs-Productions/pixi-vn/blob/4b8909bd13b1cc1fa7efb0238c44a5af3767e61f/src/sound/interfaces/AudioChannelInterface.ts#L69)

Resumes any sounds.

#### Returns [#returns-4]

`this`

Instance for chaining.

***

### stopAll() [#stopall]

\> **stopAll**(): `this`

Defined in: [src/sound/interfaces/AudioChannelInterface.ts:59](https://github.com/DRincs-Productions/pixi-vn/blob/4b8909bd13b1cc1fa7efb0238c44a5af3767e61f/src/sound/interfaces/AudioChannelInterface.ts#L59)

Stops all media currently playing through this channel.

#### Returns [#returns-5]

`this`

Instance for chaining.

***

### toggleMuteAll() [#togglemuteall]

\> **toggleMuteAll**(): `boolean`

Defined in: [src/sound/interfaces/AudioChannelInterface.ts:74](https://github.com/DRincs-Productions/pixi-vn/blob/4b8909bd13b1cc1fa7efb0238c44a5af3767e61f/src/sound/interfaces/AudioChannelInterface.ts#L74)

Toggle muted property for all sounds.

#### Returns [#returns-6]

`boolean`

`true` if all sounds are muted.
