Skip to content

UpdateMetadata no changes and hard encode [.wav] #94

Description

@yangxiaoweihn

environment:
sdk: '>=3.2.3'

audio_metadata_reader: ^1.4.2

Question 1

When calling updateMetadata to modify the information of a .wav file, there is no response.
It was found that the code lacks handling for RiffParser during the parsing process in readAllMetadata.

/// parser.dart

ParserTag readAllMetadata(File track, {bool getImage = true}) {
  final reader = track.openSync();

  try {
    if (ID3v2Parser.canUserParser(reader)) {
      return ID3v2Parser(fetchImage: getImage).parse(reader);
    } else if (FlacParser.canUserParser(reader)) {
      return FlacParser(fetchImage: getImage).parse(reader);
    } else if (MP4Parser.canUserParser(reader)) {
      return MP4Parser(fetchImage: getImage).parse(reader);
    } else if (OGGParser.canUserParser(reader)) {
      return OGGParser(fetchImage: getImage).parse(reader);
    } else if (ID3v2Parser.isID3v1(reader)) {
      return ID3v1Parser().parse(reader);
    } 
   // here need RiffParser.canUserParser(reader)
  } catch (e, trace) {
    print(trace);
    throw MetadataParserException(track: track, message: e.toString());
  }
}

After adding the missing parser, it is still not possible to modify the .wav data.

Question 2
After writing data with RiffWriter and Mp4Writer, an exception occurred due to hardcoded file paths.

/// riff_writter.dart
File("a_new.wav").writeAsBytesSync(byteBuilder.toBytes());
/// mp4_writer.dart
File("a_new.mp4").writeAsBytesSync(byteBuilder.toBytes());

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions