You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
parseWebStream() with "audio/mpeg" returns audio information without "format.numberOfSamples" attribute.
try{// Assuming you have a ReadableStream of an audio fileconstresponse=awaitfetch('http://localhost:5321/media/zahlen.mp3');constwebStream=response.body!;// Parse the metadata from the web streamconsole.log("METADATA:");constmetadata=awaitparseWebStream(webStream,'audio/mpeg');// Log the parsed metadataconsole.log(metadata);}catch(error){console.error('Error parsing metadata:',error);}
This issue is related to parsing a part of the supported audio formats like mp3, m4a a.s.o. .
I had a look on the Parser codes and found out, that "numberOfSamples" is not set there.
Expected Behavior
parseWebStream (and other parsing methods) should always return "format.numberOfSamples" attribute.
The numberOfSamples attribute is very important for calculating correct time positions in samples with the original aample rate. Knowing the maximum duration in samples is very important e.g. for annotation of audio files.
Please set "numberOfSamples" on every audio format.
Attached audio sample?
I have provided sufficient information to reproduce the issue
The text was updated successfully, but these errors were encountered:
@julianpoemp I cannot guarantee that the numberOfSamples is available for every type of audio file, as music-metadata is not designed to parse the audio portion. But for the example provided, it could be done: #2282
Is there an existing issue for this?
music-metadata version
10.5.1
Current Behavior
Audio sample (needs to be downloaded):
https://upload.poemp.net/index.php/s/Qc2qgKmcgUt55Iu/download
parseWebStream() with "audio/mpeg" returns audio information without "format.numberOfSamples" attribute.
This issue is related to parsing a part of the supported audio formats like mp3, m4a a.s.o. .
I had a look on the Parser codes and found out, that "numberOfSamples" is not set there.
Expected Behavior
parseWebStream (and other parsing methods) should always return "format.numberOfSamples" attribute.
The numberOfSamples attribute is very important for calculating correct time positions in samples with the original aample rate. Knowing the maximum duration in samples is very important e.g. for annotation of audio files.
Please set "numberOfSamples" on every audio format.
Attached audio sample?
The text was updated successfully, but these errors were encountered: