public void TestRead() { AudioReader reader = new AudioReader(); SoundData data = reader.ReadSoundFile("../../../data/sine.wav"); Assert.AreEqual(1, data.Duration, "The duration of the data is one second"); }
public void TestPipeline() { AudioReader reader = new AudioReader(); SoundData audio = reader.ReadSoundFile("../../../data/file-system.wav"); AmplitudeAnalyzer ampAnalyzer = new AmplitudeAnalyzer(); ampAnalyzer.SetVerbosity(true); SoundData[] chunks = ampAnalyzer.SplitChunks(audio); Assert.AreEqual(2, chunks.Length, "Two chunks are in the file."); }
public void TestActualData() { AudioReader reader = new AudioReader(); SoundData audio = reader.ReadSoundFile("../../../data/sample.wav"); BinaryData bin = analyzer.ConvertToSquare(audio); IEnumerator<bool> ie = bin.GetEnumerator(); while (ie.MoveNext()) { Assert.IsTrue(ie.Current, "Data values."); } }
public void TestData() { AudioReader reader = new AudioReader(); SoundData data = reader.ReadSoundFile("../../../data/sine.wav"); int length = 0; IEnumerator<Int16> ie = data.GetEnumerator(); while (ie.MoveNext()) { length++; } Assert.AreEqual(data.Length, length, "Data length"); }