# ActionSound

## Content

# Class: ActionSound

Represents an action that plays a sound.

## Extends

- [`ActionBase`](ActionBase)

## Constructors

### Constructor

```ts
new ActionSound(om): ActionSound;
```

Creates a new ActionSound.

#### Parameters

##### om

[`ObjectManager`](ObjectManager)

[ObjectManager](ObjectManager) that controls the lifetime of the ActionSound.

#### Returns

`ActionSound`

#### Overrides

```ts
ActionBase.constructor
```

### Constructor

```ts
new ActionSound(): ActionSound;
```

Creates a new ActionSound.

#### Returns

`ActionSound`

#### Overrides

```ts
ActionBase.constructor
```

## Accessors

### id

#### Get Signature

```ts
get id(): number;
```

Gets the reference to the object.

##### Returns

`number`

#### Inherited from

[`ActionBase`](ActionBase).[`id`](ActionBase#id)

***

### mix

#### Get Signature

```ts
get mix(): boolean;
```

Gets or sets a value specifying whether to mix this sound with any other sound already playing.
If false, any previously playing sound is stopped before starting this sound.
The default is false.

##### Returns

`boolean`

***

### om

#### Get Signature

```ts
get om(): ObjectManager;
```

Gets the owner [ObjectManager](ObjectManager) instance.

##### Returns

[`ObjectManager`](ObjectManager)

#### Inherited from

[`ActionBase`](ActionBase).[`om`](ActionBase#om)

***

### repeat

#### Get Signature

```ts
get repeat(): boolean;
```

Gets or sets a value specifying whether to repeat the sound indefinitely.
If true, the [synchronous](#synchronous) property is ignored.
The default is false.

##### Returns

`boolean`

***

### sound

#### Get Signature

```ts
get sound(): SoundObject;
```

Gets or sets the [SoundObject](SoundObject) specifying the sound to play.

##### Returns

[`SoundObject`](SoundObject)

***

### synchronous

#### Get Signature

```ts
get synchronous(): boolean;
```

Gets or sets a value specifying whether to play the sound synchronously or asynchronously.
If true, the viewer retains control until the sound has been completely played.
The default is false.

##### Returns

`boolean`

***

### volume

#### Get Signature

```ts
get volume(): number;
```

Gets or sets the volume at which to play the sound, in the range from -1.0 to 1.0.
The default is 1.0.

##### Returns

`number`

## Methods

### free()

```ts
free(): void;
```

Detaches the object from the [ObjectManager](ObjectManager) and deallocates its memory, if possible.

#### Returns

`void`

#### Inherited from

[`ActionBase`](ActionBase).[`free`](ActionBase#free)

***

### rebind()

```ts
rebind(omTo): void;
```

Rebinds the object from the current [ObjectManager](ObjectManager) to the specified one.

#### Parameters

##### omTo

[`ObjectManager`](ObjectManager)

The new [ObjectManager](ObjectManager) for the object.

#### Returns

`void`

#### Inherited from

[`ActionBase`](ActionBase).[`rebind`](ActionBase#rebind)
