Skip to content

Support for AudioResource #1

@KesKim

Description

@KesKim

Hi!

Unity has introduced AudioRandomContainers (ARCs for short), which shares a base class with AudioClips: the AudioResource.

When a AudioResource i.e. an ARC is used via AudioSource.resource instead of a plain AudioClip via AudioResource.clip, the AudioResource.clip will be NULL, and AudioSource.clip.length cannot be checked.

At the time of writing this there is no known / viable way to check the playing length of an AudioResource. The only thing to do would be to wait until Unity's audio team produces the next release in their API changes for AudioSource/AudioResource that should let us get our hands on more low-level information about what's playing, possibly even give the accurate ongoing play duration, or if we're wishfully thinking already, why not proper start/pause/resume/stop events built-in to the system!

Meanwhile what should be done for this repository is account for AudioSource.clip being empty without it causing NullReferenceExceptions.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions