2016-11-12 19:02:48 +03:00
|
|
|
|
using System;
|
2017-04-23 19:22:25 +03:00
|
|
|
|
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;
|
2017-06-21 01:19:47 +03:00
|
|
|
|
using SonicAudioLib.Archives;
|
2016-11-12 19:02:48 +03:00
|
|
|
|
using SonicAudioLib.IO;
|
|
|
|
|
using SonicAudioLib.CriMw;
|
2017-04-23 19:22:25 +03:00
|
|
|
|
using System.Threading.Tasks;
|
2016-11-12 19:02:48 +03:00
|
|
|
|
|
|
|
|
|
using System.Xml;
|
2017-06-21 01:19:47 +03:00
|
|
|
|
using System.Xml.Serialization;
|
2016-11-12 19:02:48 +03:00
|
|
|
|
|
|
|
|
|
namespace SonicAudioCmd
|
|
|
|
|
{
|
|
|
|
|
class Program
|
|
|
|
|
{
|
|
|
|
|
static void Main(string[] args)
|
|
|
|
|
{
|
2017-06-21 01:19:47 +03:00
|
|
|
|
using (Stream source = File.OpenRead(args[0]))
|
2017-04-17 19:06:29 +03:00
|
|
|
|
{
|
2017-06-21 01:19:47 +03:00
|
|
|
|
CriTableReader reader = CriTableReader.Create(source);
|
|
|
|
|
reader.MoveToRow(3);
|
2017-04-23 19:22:25 +03:00
|
|
|
|
|
2017-06-21 01:19:47 +03:00
|
|
|
|
long pos = reader.GetPosition("utf");
|
|
|
|
|
CriTableReader soundElementReader = reader.GetTableReader("utf");
|
2017-03-09 20:48:17 +03:00
|
|
|
|
|
2017-06-21 01:19:47 +03:00
|
|
|
|
while (soundElementReader.Read())
|
2017-04-17 19:06:29 +03:00
|
|
|
|
{
|
2017-06-21 01:19:47 +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
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|