-
Notifications
You must be signed in to change notification settings - Fork 176
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added support for MP3 with ID3V2 at start of the files
- Loading branch information
jbraendle
committed
Jan 9, 2022
1 parent
aebd639
commit c547757
Showing
5 changed files
with
57 additions
and
0 deletions.
There are no files selected for viewing
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
// Copyright (c) Drew Noakes and contributors. All Rights Reserved. Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. | ||
|
||
using MetadataExtractor.Formats.Mpeg; | ||
using MetadataExtractor.IO; | ||
using Xunit; | ||
|
||
namespace MetadataExtractor.Tests.Formats.Mpeg | ||
{ | ||
/// <summary>Unit tests for <see cref="Mp3Reader"/>.</summary> | ||
public sealed class Mp3ReaderTest | ||
{ | ||
private static Directory ProcessBytes(string file) | ||
{ | ||
using var stream = TestDataUtil.OpenRead(file); | ||
return new Mp3Reader().Extract(new SequentialStreamReader(stream)); | ||
} | ||
|
||
[Fact] | ||
public void Mp3() | ||
{ | ||
var directory = ProcessBytes("Data/file_example_MP3_5MG_short.mp3"); | ||
|
||
Assert.False(directory.HasError); | ||
|
||
Assert.Equal(320, directory.GetInt32(Mp3Directory.TagBitrate)); | ||
} | ||
|
||
[Fact] | ||
public void Mp3_IDV2() | ||
{ | ||
var directory = ProcessBytes("Data/file_example_MP3_5MG.mp3"); | ||
|
||
Assert.False(directory.HasError); | ||
|
||
Assert.Equal(320, directory.GetInt32(Mp3Directory.TagBitrate)); | ||
} | ||
|
||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters