Skip to content

Commit 0699a9a

Browse files
committed
Add loading of audio data
1 parent 031f879 commit 0699a9a

File tree

5 files changed

+22
-50
lines changed

5 files changed

+22
-50
lines changed

Duey.sln

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,6 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Duey.Abstractions", "src\Du
1414
EndProject
1515
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Duey.Provider.WZ", "src\Duey.Provider.WZ\Duey.Provider.WZ.csproj", "{6EC8524D-B087-4003-B25C-253EDB42F615}"
1616
EndProject
17-
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Testing", "src\Testing\Testing.csproj", "{A183EF54-AC94-4C7F-8537-BA8243AC81CD}"
18-
EndProject
1917
Global
2018
GlobalSection(SolutionConfigurationPlatforms) = preSolution
2119
Debug|Any CPU = Debug|Any CPU
@@ -65,23 +63,10 @@ Global
6563
{6EC8524D-B087-4003-B25C-253EDB42F615}.Release|x64.Build.0 = Release|Any CPU
6664
{6EC8524D-B087-4003-B25C-253EDB42F615}.Release|x86.ActiveCfg = Release|Any CPU
6765
{6EC8524D-B087-4003-B25C-253EDB42F615}.Release|x86.Build.0 = Release|Any CPU
68-
{A183EF54-AC94-4C7F-8537-BA8243AC81CD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
69-
{A183EF54-AC94-4C7F-8537-BA8243AC81CD}.Debug|Any CPU.Build.0 = Debug|Any CPU
70-
{A183EF54-AC94-4C7F-8537-BA8243AC81CD}.Debug|x64.ActiveCfg = Debug|Any CPU
71-
{A183EF54-AC94-4C7F-8537-BA8243AC81CD}.Debug|x64.Build.0 = Debug|Any CPU
72-
{A183EF54-AC94-4C7F-8537-BA8243AC81CD}.Debug|x86.ActiveCfg = Debug|Any CPU
73-
{A183EF54-AC94-4C7F-8537-BA8243AC81CD}.Debug|x86.Build.0 = Debug|Any CPU
74-
{A183EF54-AC94-4C7F-8537-BA8243AC81CD}.Release|Any CPU.ActiveCfg = Release|Any CPU
75-
{A183EF54-AC94-4C7F-8537-BA8243AC81CD}.Release|Any CPU.Build.0 = Release|Any CPU
76-
{A183EF54-AC94-4C7F-8537-BA8243AC81CD}.Release|x64.ActiveCfg = Release|Any CPU
77-
{A183EF54-AC94-4C7F-8537-BA8243AC81CD}.Release|x64.Build.0 = Release|Any CPU
78-
{A183EF54-AC94-4C7F-8537-BA8243AC81CD}.Release|x86.ActiveCfg = Release|Any CPU
79-
{A183EF54-AC94-4C7F-8537-BA8243AC81CD}.Release|x86.Build.0 = Release|Any CPU
8066
EndGlobalSection
8167
GlobalSection(NestedProjects) = preSolution
8268
{CB853B65-1455-4A28-BF23-B903161DBEA5} = {19B8D1C2-E056-4BE2-98CE-59269DC3182B}
8369
{648311E4-DFF6-40D3-AB49-D85B7BE036A2} = {19B8D1C2-E056-4BE2-98CE-59269DC3182B}
8470
{6EC8524D-B087-4003-B25C-253EDB42F615} = {19B8D1C2-E056-4BE2-98CE-59269DC3182B}
85-
{A183EF54-AC94-4C7F-8537-BA8243AC81CD} = {19B8D1C2-E056-4BE2-98CE-59269DC3182B}
8671
EndGlobalSection
8772
EndGlobal

src/Duey.Provider.WZ/Files/Deferred/WZPropertyCanvas.cs renamed to src/Duey.Provider.WZ/Files/Extended/WZPropertyCanvas.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
using Duey.Provider.WZ.Codecs;
66
using Duey.Provider.WZ.Crypto;
77

8-
namespace Duey.Provider.WZ.Files.Deferred;
8+
namespace Duey.Provider.WZ.Files.Extended;
99

1010
public class WZPropertyCanvas : WZPropertyDeferred<DataBitmap>
1111
{

src/Duey.Provider.WZ/Files/WZPropertyFile.cs

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,16 @@
33
using Duey.Abstractions.Types;
44
using Duey.Provider.WZ.Codecs;
55
using Duey.Provider.WZ.Crypto;
6-
using Duey.Provider.WZ.Files.Deferred;
6+
using Duey.Provider.WZ.Files.Extended;
77
using Duey.Provider.WZ.Types;
88

99
namespace Duey.Provider.WZ.Files;
1010

1111
public class WZPropertyFile : AbstractWZNode, IDataNode
1212
{
13+
private static readonly Guid GUIDAudioFormatWav = new("05589f81-c356-11ce-bf01-00aa0055595a");
14+
private static readonly Guid GUIDAudioFormatNone = new("00000000-0000-0000-0000-000000000000");
15+
1316
protected readonly MemoryMappedFile _view;
1417
protected readonly XORCipher _cipher;
1518
protected readonly int _start;
@@ -105,6 +108,23 @@ public override IEnumerable<IDataNode> Children
105108
reader.ReadCompressedInt()
106109
));
107110
break;
111+
case "Sound_DX8":
112+
reader.ReadByte();
113+
114+
var length = reader.ReadCompressedInt();
115+
var duration = reader.ReadCompressedInt();
116+
117+
reader.BaseStream.Position += 1 + 16 + 16 + 2;
118+
119+
var format = new Guid(reader.ReadBytes(16));
120+
121+
if (format == GUIDAudioFormatWav)
122+
reader.BaseStream.Position += reader.ReadCompressedInt();
123+
124+
yield return new WZPropertyData<DataAudio>(name, this, new DataAudio(
125+
reader.ReadBytes(length)
126+
));
127+
break;
108128
}
109129

110130
reader.BaseStream.Position = position + size;

src/Testing/Program.cs

Lines changed: 0 additions & 14 deletions
This file was deleted.

src/Testing/Testing.csproj

Lines changed: 0 additions & 19 deletions
This file was deleted.

0 commit comments

Comments
 (0)