47 lines
1.4 KiB
C#
Raw Normal View History

2016-11-12 19:02:48 +03:00
using System;
using System.Collections;
2016-11-12 19:02:48 +03:00
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;
using System.IO.Compression;
using SonicAudioLib;
using SonicAudioLib.Archives;
2016-11-12 19:02:48 +03:00
using SonicAudioLib.IO;
using SonicAudioLib.CriMw;
using System.Threading.Tasks;
2016-11-12 19:02:48 +03:00
using System.Xml;
using System.Xml.Serialization;
2016-11-12 19:02:48 +03:00
namespace SonicAudioCmd
{
class Program
{
static void Main(string[] args)
{
using (Stream source = File.OpenRead(args[0]))
2017-04-17 19:06:29 +03:00
{
CriTableReader reader = CriTableReader.Create(source);
reader.MoveToRow(3);
long pos = reader.GetPosition("utf");
CriTableReader soundElementReader = reader.GetTableReader("utf");
while (soundElementReader.Read())
2017-04-17 19:06:29 +03:00
{
CriTable table = new CriTable();
table.Read(soundElementReader.GetSubStream("data"));
using (Stream output = File.Create(Path.GetFileName(soundElementReader.GetString("name") + "_" + table.Rows[0].GetValue<byte>("lpflg") + "_" + ".dsp")))
{
DataStream.WriteBytes(output, table.Rows[0].GetValue<byte[]>("header"));
DataStream.WriteBytes(output, table.Rows[0].GetValue<byte[]>("data"));
}
2017-04-17 19:06:29 +03:00
}
}
2016-11-12 19:02:48 +03:00
}
}
}