Skip to content

Sound aliases from AssetPack manifest only use the first alias entry #282

Closed

Description

@StitchAndGlitchStudio

I am using AssetPack which generates the manifest and inside I have this for a sound:

"alias": ["main/sounds/sfx-hover.wav", "sfx-hover.wav"],
"src": ["main/sounds/sfx-hover-Ztp4.mp3", "main/sounds/sfx-hover-EVdVmg.ogg"],

Then

sound.play("main/sounds/sfx-hover.wav");  // works
sound.play("sfx-hover.wav");  // doesn't work

The reason is in src/soundAsset.ts where

const getAlias = (asset: ResolvedAsset) =>
{
    const src = asset.src;
    let alias = asset?.alias?.[0];

    if (!alias || asset.src === alias)
    {
        alias = path.basename(src, path.extname(src));
    }

    return alias;
};

obviously gets only the 1st alias from the manifest.

So a fix for this would be nice :)

Activity

  1. bigtimebuddy commented on May 24, 2026

    @bigtimebuddy
    Member

    Turning this into a find() seems better. Want to make a PR for this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions