public void AdpcmIsSameAfterAligningAndUnaligning() { GcAdpcmChannel channel = GetBuilder(100).WithLoop(true, 10, 100).Build(); GcAdpcmChannel channel2 = channel.GetCloneBuilder().WithLoopAlignment(15).Build(); GcAdpcmChannel channel3 = channel2.GetCloneBuilder().WithLoopAlignment(0).Build(); Assert.Same(channel.GetAdpcmAudio(), channel3.GetAdpcmAudio()); Assert.NotSame(channel.GetAdpcmAudio(), channel2.GetAdpcmAudio()); }
public void AdpcmIsSameAfterAligningAndRebuilding() { GcAdpcmChannel channel = GetBuilder(100).WithLoop(true, 10, 100).WithLoopAlignment(15).Build(); GcAdpcmChannel channel2 = channel.GetCloneBuilder().WithSamplesPerSeekTableEntry(10).Build(); Assert.Same(channel.GetAdpcmAudio(), channel2.GetAdpcmAudio()); }
public void AdpcmLengthIsCorrectAfterRealignment() { GcAdpcmChannel channel = GetBuilder(100).WithLoop(true, 10, 100).WithLoopAlignment(15).Build(); GcAdpcmChannel channel2 = channel.GetCloneBuilder().WithLoopAlignment(20).Build(); Assert.Equal(GcAdpcmMath.SampleCountToByteCount(110), channel2.GetAdpcmAudio().Length); }
private bool CompareEncodingCoarse(short[] pcm) { GcAdpcmChannel adpcmA = null; GcAdpcmChannel adpcmB = null; Parallel.Invoke( () => adpcmA = DllA.EncodeChannel(pcm), () => adpcmB = DllB.EncodeChannel(pcm) ); return(ArraysEqual(adpcmA.Coefs, adpcmB.Coefs) == -1 && ArraysEqual(adpcmA.GetAdpcmAudio(), adpcmB.GetAdpcmAudio()) == -1); }
public short[] DecodeChannel(GcAdpcmChannel channel) { return(DecodeAdpcm(channel.GetAdpcmAudio(), channel.Coefs, channel.SampleCount)); }
public void AdpcmLengthIsCorrectAfterBuilding() { GcAdpcmChannel channel = GetBuilder(100).WithLoop(true, 10, 100).Build(); Assert.Equal(GcAdpcmMath.SampleCountToByteCount(100), channel.GetAdpcmAudio().Length); }