Class: SoundSprite


Object that represents a single Sound's sprite. To add sound sprites use the Sound#addSprites method.

new SoundSprite (parent, options)

Name Type Description
parent Sound

The parent sound

options SoundSpriteData

Data associated with object.


 import { sound } from '@pixi/sound';
 sound.add('alias', {
   url: 'path/to/file.ogg',
   sprites: {
     blast: { start: 0, end: 0.2 },
     boom: { start: 0.3, end: 0.5 },
   loaded() {'alias', 'blast');


duration number readonly

The duration of the sound in seconds.

end number readonly

The ending location in seconds

loop boolean readonly

Whether to loop the sound sprite.

parent Sound readonly

The reference sound

speed number readonly

The speed override where 1 is 100% speed playback.

start number readonly

The starting location in seconds.


destroy () void

Destroy and don't use after this

play (complete) IMediaInstance | IMediaInstance<Promise>

Play the sound sprite.

Name Type Attributes Description
complete Function <optional>

Function call when complete

Type Description
IMediaInstance | IMediaInstance<Promise> Sound instance being played.