Skip to content

Remote NetMD SP upload fails because SPS is not mapped to SP #101

Description

@yooamatwa-pixel

Hi, thanks for making this awesome tool.

I’ve been experimenting with Remote NetMD and encountered an issue when uploading tracks in SP Stereo.

When uploading an SP Stereo track through a Remote NetMD device, the browser encryption worker crashes with:

RangeError: Invalid array length

LP2 uploads work correctly.

The Remote NetMD server receives the SP upload request as:

/upload/.websocket?...&format=SPS

The issue appears to be in src/services/interfaces/remote-netmd.ts.

The remote upload path explicitly converts ATRAC3 formats:

AT3 / 132 → LP2
AT3 / 66 → LP4

However, non-AT3 formats are passed through unchanged. This means SP Stereo remains SPS rather than being converted to the NetMD wire format SP.

Later, the code uses:
WireformatDict[format.codec]

However, WireformatDict contains SP, LP2, LP105, and LP4, but not SPS or SPM.

As a result, an SP Stereo upload attempts to access:

WireformatDict['SPS']

which returns undefined and eventually causes the encryption worker to throw:

RangeError: Invalid array length

I tested the following change:


const format =
    _format.codec === 'AT3'
        ? { codec: _format.bitrate === 66 ? 'LP4' : 'LP2' }
        : _format.codec === 'SPS' || _format.codec === 'SPM'
          ? { codec: 'SP' }
          : _format;

After applying this locally and rebuilding Web MiniDisc, an SP Stereo upload completed successfully through Remote NetMD.

I have only directly tested SPS; SPM appears likely to be affected by the same issue.

Thanks!

Activity

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

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions