Sound(ID)

base classes — bpy_struct, ID

class bpy.types.Sound(ID)

Sound data-block referencing an external or packed sound file

channels

Definition of audio channels (default 'INVALID', readonly)

  • INVALID Invalid – Invalid.

  • MONO Mono – Mono.

  • STEREO Stereo – Stereo.

  • STEREO_LFE Stereo LFE – Stereo FX.

  • CHANNELS_4 4 Channels – 4 Channels.

  • CHANNELS_5 5 Channels – 5 Channels.

  • SURROUND_51 5.1 Surround – 5.1 Surround.

  • SURROUND_61 6.1 Surround – 6.1 Surround.

  • SURROUND_71 7.1 Surround – 7.1 Surround.

Type:

Literal[‘INVALID’, ‘MONO’, ‘STEREO’, ‘STEREO_LFE’, ‘CHANNELS_4’, ‘CHANNELS_5’, ‘SURROUND_51’, ‘SURROUND_61’, ‘SURROUND_71’]

filepath

Sound sample file used by this Sound data-block (default “”, never None, blend relative // prefix supported)

Type:

str

packed_file

(readonly)

Type:

PackedFile

samplerate

Sample rate of the audio in Hz (in [-inf, inf], default 0, readonly)

Type:

int

use_memory_cache

The sound file is decoded and loaded into RAM (default False)

Type:

bool

use_mono

If the file contains multiple audio channels they are rendered to a single one (default False)

Type:

bool

factory

The aud.Factory object of the sound.

(readonly)

pack()

Pack the sound into the current blend file

unpack(*, method='USE_LOCAL')

Unpack the sound to the samples filename

Parameters:

method (Literal[Unpack Method Items]) – method, How to unpack (optional)

classmethod bl_rna_get_subclass(id, default=None, /)
Parameters:
  • id (str) – The RNA type identifier.

  • default (bpy.types.Struct | None) – The value to return when not found.

Returns:

The RNA type or default when not found.

Return type:

bpy.types.Struct

classmethod bl_rna_get_subclass_py(id, default=None, /)
Parameters:
  • id (str) – The RNA type identifier.

  • default (type | None) – The value to return when not found.

Returns:

The class or default when not found.

Return type:

type

Inherited Properties

Inherited Functions

References