Skip to content

Warning on opus file after tag editing. #138

@M4RC3L05

Description

@M4RC3L05

Hi,

Been using this lib to edit tags on opus audio files.
Recently started to use the bin opusinfo to check the opus files and when i edit them using this lib i get this warnings in the output of opusinfo:

New logical stream (#1, serial: 4d7e1019): type opus
Encoded with Lavf62.12.101
User comments section follows...
[...TAGS...]
WARNING: sequence number gap in stream 1. Got page 2 when expecting page 5. Indicates missing data.
WARNING: discontinuity in stream (1)
Opus stream 1:
[...STREAM INFO...]
Logical stream 1 ended

The file is completely playable and no weird skips in the playback, just wanted to make sure that we can safely ignore these warnings, or simply i am not using this lib correctly.

The code i use to edit the tags is as follows:

export const setMusicFileMetadata = (
  { path, metadata }: {
    path: string;
    metadata: SetMusicFileMetadataPayload;
  },
) => {
  const file = File.createFromPath(path);

  if (metadata.album) file.tag.album = metadata.album;
  if (metadata.year) file.tag.year = Number(metadata.year);

  if (metadata.albumArtist) {
    file.tag.albumArtists = [metadata.albumArtist];
  }
  if (metadata.genre) file.tag.genres = [metadata.genre];
  if (metadata.artist) file.tag.performers = [metadata.artist];
  if (metadata.title) file.tag.title = metadata.title;
  if (metadata.track) file.tag.track = Number(metadata.track);
  if (metadata.trackCount) file.tag.trackCount = Number(metadata.trackCount);
  if (metadata.disc) file.tag.disc = Number(metadata.disc);
  if (metadata.discCount) file.tag.discCount = Number(metadata.discCount);

  if (metadata.cover && metadata.cover.data.length > 0) {
    file.tag.pictures = [{
      data: ByteVector.fromByteArray(metadata.cover.data),
      description: "",
      filename: "",
      mimeType: metadata.cover.mimetype,
      type: PictureType.FrontCover,
    }];
  }

  file.save();
  file.dispose();
};

Thanks for the awesome lib btw.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions