Пример #1
0
        protected override void CustomFileExport(ExportParameters exportParameters)
        {
            var outputPath    = Path.GetFullPath(Path.Combine(exportParameters.OutputDirectory, exportParameters.FileRecord.Name + exportParameters.FileExtension));
            var soundResource = SoundResource.Create(exportParameters.FileRecord.Info?.VersionHash ?? string.Empty);

            soundResource.InitFromRecord(exportParameters.BagStream, exportParameters.FileRecord);

            LibFSB.SaveAs(soundResource.Resource.Data.Data, outputPath);
            exportParameters.OnProgressReport?.Invoke(exportParameters.FileRecord, 0);
        }
Пример #2
0
        public void TestGetImageBytes()
        {
            var fsbPath  = Path.Combine(TestContext.CurrentContext.TestDirectory, "Samples", "Resources", "Sound", "Sample.fsb");
            var fsbBytes = File.ReadAllBytes(fsbPath);

            var expectedWavPath  = Path.Combine(TestContext.CurrentContext.TestDirectory, "Samples", "Resources", "Sound", "ExpectedOutput.wav");
            var expectedWavBytes = File.ReadAllBytes(expectedWavPath);

            var outputWavPath = Path.Combine(TestContext.CurrentContext.TestDirectory, "Samples", "Resources", "Sound", "output.wav");

            LibFSB.SaveAs(fsbBytes, outputWavPath);

            var outputWavBytes = File.ReadAllBytes(outputWavPath);

            Assert.AreEqual(expectedWavBytes, outputWavBytes);
        }