Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
neilharvey committed Sep 15, 2022
2 parents 50d11cf + 36b0a15 commit 23f36a7
Show file tree
Hide file tree
Showing 7 changed files with 34 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/FileSignatures/Formats/Amr.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
namespace FileSignatures.Formats
{
/// <summary>
/// Specifies the format of an Adaptive Multi-Rate ACELP (Algebraic Code Excited Linear Prediction) Codec file
/// Commonly audio format with GSM cell phones. (See RFC 4867.)
/// </summary>
public class Amr : FileFormat
{
public Amr() : base(new byte[] { 0x23, 0x21, 0x41, 0x4D, 0x52 }, "audio/amr", "amr") { }
}
}
10 changes: 10 additions & 0 deletions src/FileSignatures/Formats/Mpeg3.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
namespace FileSignatures.Formats
{
/// <summary>
/// Specifies the format of a MPEG-1 Audio Layer 3 (MP3) audio file
/// </summary>
public class Mpeg3 : FileFormat
{
public Mpeg3() : base(new byte[] { 0x49, 0x44, 0x33 }, "audio/mpeg", "mp3") { }
}
}
10 changes: 10 additions & 0 deletions src/FileSignatures/Formats/Ogg.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
namespace FileSignatures.Formats
{
/// <summary>
/// Specifies the format of an Ogg Vorbis Codec compressed Multimedia file
/// </summary>
public class Ogg : FileFormat
{
public Ogg() : base(new byte[] { 0x4F, 0x67, 0x67, 0x53, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, "audio/ogg", "ogg") { }
}
}
3 changes: 3 additions & 0 deletions test/FileSignatures.Tests/FunctionalTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,9 @@ public class FunctionalTests
[InlineData("test.mov", "video/quicktime")]
[InlineData("test.3gp", "video/3gpp")]
[InlineData("test.vcf", "text/vcard")]
[InlineData("test.mp3", "audio/mpeg")]
[InlineData("test.ogg", "audio/ogg")]
[InlineData("test.amr", "audio/amr")]
public void SamplesAreRecognised(string sample, string expected)
{
var result = InspectSample(sample);
Expand Down
Binary file added test/FileSignatures.Tests/Samples/test.amr
Binary file not shown.
Binary file added test/FileSignatures.Tests/Samples/test.mp3
Binary file not shown.
Binary file added test/FileSignatures.Tests/Samples/test.ogg
Binary file not shown.

0 comments on commit 23f36a7

Please sign in to comment.