This repository has been archived by the owner on Jan 15, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Klassediagrammer, StyleCop analyzer, og har tilføjet kommentarer til …
…hele Aud.IO.
- Loading branch information
1 parent
339eac2
commit 6b4c882
Showing
14 changed files
with
258 additions
and
53 deletions.
There are no files selected for viewing
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,4 @@ | ||
[*.cs] | ||
|
||
# SA1101: Prefix local calls with this | ||
dotnet_diagnostic.SA1101.severity = silent |
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,60 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<ClassDiagram MajorVersion="1" MinorVersion="1"> | ||
<Class Name="Aud.IO.Exceptions.MissingSubchunkException" Collapsed="true"> | ||
<Position X="1.25" Y="4.5" Width="1.5" /> | ||
<TypeIdentifier> | ||
<HashCode>AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=</HashCode> | ||
<FileName>Exceptions\MissingSubchunkException.cs</FileName> | ||
</TypeIdentifier> | ||
</Class> | ||
<Class Name="Aud.IO.Exceptions.UnknownFileFormatDescriptorException" Collapsed="true"> | ||
<Position X="3" Y="4.5" Width="1.5" /> | ||
<TypeIdentifier> | ||
<HashCode>AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=</HashCode> | ||
<FileName>Exceptions\UnknownFileFormatDescriptorException.cs</FileName> | ||
</TypeIdentifier> | ||
</Class> | ||
<Class Name="Aud.IO.Exceptions.UnknownFileFormatException" Collapsed="true"> | ||
<Position X="1.25" Y="3.5" Width="1.5" /> | ||
<TypeIdentifier> | ||
<HashCode>AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=</HashCode> | ||
<FileName>Exceptions\UnknownFileFormatException.cs</FileName> | ||
</TypeIdentifier> | ||
</Class> | ||
<Class Name="Aud.IO.Formats.WaveFile"> | ||
<Position X="3" Y="0.5" Width="1.5" /> | ||
<TypeIdentifier> | ||
<HashCode>BAAAAAABQAAAAAAAgAEAAAAAAABAAgQgAAAAAAAAAAA=</HashCode> | ||
<FileName>Formats\WaveFile.cs</FileName> | ||
</TypeIdentifier> | ||
</Class> | ||
<Class Name="Aud.IO.AudioFile"> | ||
<Position X="1.25" Y="0.5" Width="1.5" /> | ||
<TypeIdentifier> | ||
<HashCode>BAAAAAAAQAAAAAAAgAAAAAAAAABAAgQgAAAAAAAAAAA=</HashCode> | ||
<FileName>AudioFile.cs</FileName> | ||
</TypeIdentifier> | ||
</Class> | ||
<Struct Name="Aud.IO.Formats.WaveStructure"> | ||
<Position X="4.75" Y="0.5" Width="1.5" /> | ||
<TypeIdentifier> | ||
<HashCode>AAAAAAAACAAAAAAEIAAAAAAAAAgAAAAAAAAAAAAEAAA=</HashCode> | ||
<FileName>Formats\WaveStructure.cs</FileName> | ||
</TypeIdentifier> | ||
</Struct> | ||
<Struct Name="Aud.IO.Formats.FormatSubchunk"> | ||
<Position X="6.5" Y="0.5" Width="1.5" /> | ||
<TypeIdentifier> | ||
<HashCode>BAAAAAAAAAAAgAAgAAAAAAAAACABAgAAAAAAAAAACAA=</HashCode> | ||
<FileName>Formats\WaveStructure.cs</FileName> | ||
</TypeIdentifier> | ||
</Struct> | ||
<Struct Name="Aud.IO.Formats.DataSubchunk"> | ||
<Position X="4.75" Y="3.5" Width="1.5" /> | ||
<TypeIdentifier> | ||
<HashCode>AAAAAAAAAAAAgAAAAAAAAAAAAAAAABAAAAAAAAAAAAA=</HashCode> | ||
<FileName>Formats\WaveStructure.cs</FileName> | ||
</TypeIdentifier> | ||
</Struct> | ||
<Font Name="Segoe UI" Size="9" /> | ||
</ClassDiagram> |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,38 +1,53 @@ | ||
namespace Aud.IO | ||
{ | ||
/// <summary> | ||
/// An abstract class for implementing audio formats. | ||
/// </summary> | ||
public abstract class AudioFile | ||
{ | ||
/// <summary> | ||
/// Audio duration in seconds. | ||
/// Initializes a new instance of the <see cref="AudioFile"/> class. | ||
/// Constructor parameters to enforce design pattern. | ||
/// </summary> | ||
/// <param name="filePath">File to load.</param> | ||
public AudioFile(string filePath) { } | ||
|
||
/// <summary> | ||
/// Gets audio duration in seconds. | ||
/// </summary> | ||
public abstract double AudioDuration { get; } | ||
|
||
/// <summary> | ||
/// The rate at which the audio is sampled. | ||
/// Gets the rate at which the audio is sampled. | ||
/// </summary> | ||
public abstract uint SampleRate { get; } | ||
|
||
/// <summary> | ||
/// The amount of samples, (including all channels). | ||
/// Gets the amount of samples, (including all channels). | ||
/// </summary> | ||
public abstract int Samples { get; } | ||
|
||
/// <summary> | ||
/// The amount of bits that store a single sample. | ||
/// Gets the amount of bits that store a single sample. | ||
/// </summary> | ||
public abstract uint BitsPerSample { get; } | ||
|
||
public AudioFile(string filePath) { } | ||
|
||
/// <summary> | ||
/// Writes the audio file to the specified file path (doesn't add extension). | ||
/// </summary> | ||
/// <param name="filePath">The file to load.</param> | ||
public abstract void WriteAudioFile(string filePath); | ||
|
||
/// <summary> | ||
/// Returns the audio data in analog (demodulated from LPCM). | ||
/// </summary> | ||
/// <returns></returns> | ||
/// <returns>LPCM demodulated audio.</returns> | ||
public abstract double[] GetDemodulatedAudio(); | ||
|
||
/// <summary> | ||
/// Set audio by audio data not modulated using LPCM. | ||
/// Sets audio by audio data not modulated using LPCM. | ||
/// </summary> | ||
/// <param name="audio"></param> | ||
/// <param name="audio">LPCM modulated audio.</param> | ||
public abstract void SetDemodulatedAudio(double[] audio); | ||
} | ||
} |
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 |
---|---|---|
@@ -1,9 +1,8 @@ | ||
using System; | ||
|
||
namespace Aud.IO.Exceptions | ||
namespace Aud.IO.Exceptions | ||
{ | ||
public class MissingSubchunkException : Exception | ||
public class MissingSubchunkException : System.Exception | ||
{ | ||
public MissingSubchunkException(string message) : base(message) { } | ||
public MissingSubchunkException(string message) | ||
: base(message) { } | ||
} | ||
} |
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 |
---|---|---|
@@ -1,9 +1,8 @@ | ||
using System; | ||
|
||
namespace Aud.IO.Exceptions | ||
namespace Aud.IO.Exceptions | ||
{ | ||
public class UnknownFileFormatDescriptorException : Exception | ||
public class UnknownFileFormatDescriptorException : System.Exception | ||
{ | ||
public UnknownFileFormatDescriptorException(string message) : base(message) { } | ||
public UnknownFileFormatDescriptorException(string message) | ||
: base(message) { } | ||
} | ||
} |
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 |
---|---|---|
@@ -1,9 +1,11 @@ | ||
using System; | ||
|
||
namespace Aud.IO.Exceptions | ||
namespace Aud.IO.Exceptions | ||
{ | ||
public class UnknownFileFormatException : Exception | ||
/// <summary> | ||
/// Exception thrown when the file format declared in the file is unexpected. | ||
/// </summary> | ||
public class UnknownFileFormatException : System.Exception | ||
{ | ||
public UnknownFileFormatException(string message) : base(message) { } | ||
public UnknownFileFormatException(string message) | ||
: base(message) { } | ||
} | ||
} |
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
Oops, something went wrong.