mirror of
https://github.com/blueskythlikesclouds/SonicAudioTools.git
synced 2024-11-23 22:50:58 +01:00
Fix delay time playback
This commit is contained in:
parent
6f0437eaf7
commit
218f1b8f37
@ -1,3 +1,9 @@
|
|||||||
|
Dependency Copyright Notices:
|
||||||
|
|
||||||
|
======
|
||||||
|
NAudio
|
||||||
|
======
|
||||||
|
|
||||||
Microsoft Public License (Ms-PL)
|
Microsoft Public License (Ms-PL)
|
||||||
|
|
||||||
This license governs use of the accompanying software. If you use the software, you accept this license. If you do not accept the license, do not use the software.
|
This license governs use of the accompanying software. If you use the software, you accept this license. If you do not accept the license, do not use the software.
|
||||||
@ -28,4 +34,29 @@ A "contributor" is any person that distributes its contribution under this licen
|
|||||||
|
|
||||||
(D) If you distribute any portion of the software in source code form, you may do so only under this license by including a complete copy of this license with your distribution. If you distribute any portion of the software in compiled or object code form, you may only do so under a license that complies with this license.
|
(D) If you distribute any portion of the software in source code form, you may do so only under this license by including a complete copy of this license with your distribution. If you distribute any portion of the software in compiled or object code form, you may only do so under a license that complies with this license.
|
||||||
|
|
||||||
(E) The software is licensed "as-is." You bear the risk of using it. The contributors give no express warranties, guarantees or conditions. You may have additional consumer rights under your local laws which this license cannot change. To the extent permitted under your local laws, the contributors exclude the implied warranties of merchantability, fitness for a particular purpose and non-infringement.
|
(E) The software is licensed "as-is." You bear the risk of using it. The contributors give no express warranties, guarantees or conditions. You may have additional consumer rights under your local laws which this license cannot change. To the extent permitted under your local laws, the contributors exclude the implied warranties of merchantability, fitness for a particular purpose and non-infringement.
|
||||||
|
|
||||||
|
=========
|
||||||
|
vgmstream
|
||||||
|
=========
|
||||||
|
|
||||||
|
Copyright (c) 2008-2010 Adam Gashlin, Fastelbja, Ronny Elfert
|
||||||
|
|
||||||
|
Portions Copyright (c) 2004-2008, Marko Kreen
|
||||||
|
Portions Copyright 2001-2007 jagarl / Kazunori Ueno <jagarl@creator.club.ne.jp>
|
||||||
|
Portions Copyright (c) 1998, Justin Frankel/Nullsoft Inc.
|
||||||
|
Portions Copyright (C) 2006 Nullsoft, Inc.
|
||||||
|
Portions Copyright (c) 2005-2007 Paul Hsieh
|
||||||
|
Portions Public Domain originating with Sun Microsystems
|
||||||
|
|
||||||
|
Permission to use, copy, modify, and distribute this software for any
|
||||||
|
purpose with or without fee is hereby granted, provided that the above
|
||||||
|
copyright notice and this permission notice appear in all copies.
|
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
||||||
|
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
||||||
|
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
||||||
|
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
||||||
|
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
||||||
|
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
||||||
|
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
@ -1,20 +0,0 @@
|
|||||||
Copyright (c) 2008-2010 Adam Gashlin, Fastelbja, Ronny Elfert
|
|
||||||
|
|
||||||
Portions Copyright (c) 2004-2008, Marko Kreen
|
|
||||||
Portions Copyright 2001-2007 jagarl / Kazunori Ueno <jagarl@creator.club.ne.jp>
|
|
||||||
Portions Copyright (c) 1998, Justin Frankel/Nullsoft Inc.
|
|
||||||
Portions Copyright (C) 2006 Nullsoft, Inc.
|
|
||||||
Portions Copyright (c) 2005-2007 Paul Hsieh
|
|
||||||
Portions Public Domain originating with Sun Microsystems
|
|
||||||
|
|
||||||
Permission to use, copy, modify, and distribute this software for any
|
|
||||||
purpose with or without fee is hereby granted, provided that the above
|
|
||||||
copyright notice and this permission notice appear in all copies.
|
|
||||||
|
|
||||||
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
||||||
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
||||||
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
||||||
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
||||||
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
||||||
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
|
||||||
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
29
README.md
29
README.md
@ -1,24 +1,29 @@
|
|||||||
# Sonic Audio Tools
|
# Sonic Audio Tools
|
||||||
Sonic Audio Tools is a set of tools for editing the audio formats seen in Sonic the Hedgehog games. Currently, it's mostly focused on CRIWARE's audio formats, this means that these tools can be used to edit files from any game, as long as they are CSB, CPK, ACB or AWB.
|
Tools for editing CriMw / CriWare file formats. (CSB / CPK / ACB / AWB)
|
||||||
## Releases
|
## Releases
|
||||||
[Here.](https://ci.appveyor.com/project/blueskythlikesclouds/sonicaudiotools/build/artifacts)
|
[On the AppVeyor page.](https://ci.appveyor.com/project/blueskythlikesclouds/sonicaudiotools/build/artifacts)
|
||||||
|
AppVeyor builds every commit automatically, so you can get the executables from the link above.
|
||||||
|
Stable builds are planned to be published [here.](https://github.com/blueskythlikesclouds/SonicAudioTools/releases)
|
||||||
|
|
||||||
## Building
|
## Building
|
||||||
|
If you still wish to build the solution yourself, this is what you should do:
|
||||||
1. Clone from [GitHub](https://github.com/blueskythlikesclouds/SonicAudioTools.git) `git clone https://github.com/blueskythlikesclouds/SonicAudioTools.git`
|
1. Clone from [GitHub](https://github.com/blueskythlikesclouds/SonicAudioTools.git) `git clone https://github.com/blueskythlikesclouds/SonicAudioTools.git`
|
||||||
2. Open the solution in Visual Studio. (Visual Studio 2017 or later is required.)
|
2. Open the solution in Visual Studio. (Visual Studio 2017 or later is required.)
|
||||||
3. Install the missing NuGet packages.
|
3. Install the missing NuGet packages.
|
||||||
4. Build the solution.
|
4. Build the solution.
|
||||||
|
|
||||||
## Projects
|
## Projects
|
||||||
For more information about the projects, visit the [wiki](https://github.com/blueskythlikesclouds/SonicAudioTools/wiki) page.
|
To see more information about projects, visit the [wiki](https://github.com/blueskythlikesclouds/SonicAudioTools/wiki).
|
||||||
### [SonicAudioLib](https://github.com/blueskythlikesclouds/SonicAudioTools/tree/master/Source/SonicAudioLib)
|
### [Sonic Audio Library](https://github.com/blueskythlikesclouds/SonicAudioTools/tree/master/Source/SonicAudioLib)
|
||||||
Core class library of the solution. Handles the IO work of the other projects.
|
Main class library of the solution. Contains classes for IO and file formats.
|
||||||
### [AcbEditor](https://github.com/blueskythlikesclouds/SonicAudioTools/tree/master/Source/AcbEditor)
|
### [ACB Editor](https://github.com/blueskythlikesclouds/SonicAudioTools/tree/master/Source/AcbEditor)
|
||||||
A tool to replace audio data in ACB files. Handles both ACBs and AWBs. Old ACB versions which had CPKs for storage are also supported.
|
Audio data replacer for ACB / AWB files. Supports really old ACB files as well, which stored CPK files instead of currently used AWB files. Usage is explained in the program.
|
||||||
### [CsbBuilder](https://github.com/blueskythlikesclouds/SonicAudioTools/tree/master/Source/CsbBuilder)
|
NOTE: It doesn't extract cue names so every audio will have its id on extracted file name.
|
||||||
A fully functional CSB creator. It's currently able to load any CSB file as long as they contain ADX files. It also always builds in the latest CSB version, which appeared probably around 2010.
|
### [CSB Builder](https://github.com/blueskythlikesclouds/SonicAudioTools/tree/master/Source/CsbBuilder)
|
||||||
### [CsbEditor](https://github.com/blueskythlikesclouds/SonicAudioTools/tree/master/Source/CsbEditor)
|
CSB file importer/builder. Allows you to fully edit CSB files, preview your changes, add/remove cues, etc.
|
||||||
A tool to replace audio data in CSB files. Handles both CSBs and CPKs.
|
### [CSB Editor](https://github.com/blueskythlikesclouds/SonicAudioTools/tree/master/Source/CsbEditor)
|
||||||
|
Audio data replacer for CSB / CPK files. It works like ACB Editor and is a lot simpler than CSB Builder.
|
||||||
|
|
||||||
## License
|
## License
|
||||||
See [LICENSE.txt](https://github.com/blueskythlikesclouds/SonicAudioTools/blob/master/LICENSE.txt)
|
Sonic Audio Tools uses the MIT license, meaning you're able to use and modify the code freely, as long as you include the copyright notice.
|
||||||
|
For more details, see [LICENSE](https://github.com/blueskythlikesclouds/SonicAudioTools/blob/master/LICENSE)
|
||||||
|
@ -9,7 +9,7 @@
|
|||||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||||
<RootNamespace>AcbEditor</RootNamespace>
|
<RootNamespace>AcbEditor</RootNamespace>
|
||||||
<AssemblyName>AcbEditor</AssemblyName>
|
<AssemblyName>AcbEditor</AssemblyName>
|
||||||
<TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion>
|
<TargetFrameworkVersion>v4.5.2</TargetFrameworkVersion>
|
||||||
<FileAlignment>512</FileAlignment>
|
<FileAlignment>512</FileAlignment>
|
||||||
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
|
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
|
||||||
<TargetFrameworkProfile />
|
<TargetFrameworkProfile />
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
</sectionGroup>
|
</sectionGroup>
|
||||||
</configSections>
|
</configSections>
|
||||||
<startup>
|
<startup>
|
||||||
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.1"/>
|
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5.2"/>
|
||||||
</startup>
|
</startup>
|
||||||
<userSettings>
|
<userSettings>
|
||||||
<AcbEditor.Properties.Settings>
|
<AcbEditor.Properties.Settings>
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<configuration>
|
<configuration>
|
||||||
<startup>
|
<startup>
|
||||||
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.1"/>
|
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5.2"/>
|
||||||
</startup>
|
</startup>
|
||||||
</configuration>
|
</configuration>
|
||||||
|
@ -15,15 +15,13 @@ namespace CsbBuilder.Audio
|
|||||||
|
|
||||||
private double volume = 1;
|
private double volume = 1;
|
||||||
private double pitch = 0;
|
private double pitch = 0;
|
||||||
private long delayTime = 0;
|
private long delayBytes = 0;
|
||||||
private DateTime startTime;
|
|
||||||
|
|
||||||
public override WaveFormat WaveFormat
|
public override WaveFormat WaveFormat
|
||||||
{
|
{
|
||||||
get
|
get
|
||||||
{
|
{
|
||||||
WaveFormat waveFormat = streams[currentStreamIndex].WaveFormat;
|
WaveFormat waveFormat = streams[currentStreamIndex].WaveFormat;
|
||||||
|
|
||||||
return new WaveFormat(waveFormat.SampleRate + (int)(waveFormat.SampleRate * pitch), waveFormat.Channels);
|
return new WaveFormat(waveFormat.SampleRate + (int)(waveFormat.SampleRate * pitch), waveFormat.Channels);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -77,12 +75,16 @@ namespace CsbBuilder.Audio
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public int DelayTime
|
public long DelayTime
|
||||||
{
|
{
|
||||||
set
|
set
|
||||||
{
|
{
|
||||||
startTime = DateTime.Now;
|
delayBytes = (long)((value / 1000.0) * WaveFormat.AverageBytesPerSecond);
|
||||||
delayTime = value * 10000;
|
|
||||||
|
if ((delayBytes % 2) != 0)
|
||||||
|
{
|
||||||
|
delayBytes++;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -90,14 +92,20 @@ namespace CsbBuilder.Audio
|
|||||||
|
|
||||||
public override int Read(byte[] buffer, int offset, int count)
|
public override int Read(byte[] buffer, int offset, int count)
|
||||||
{
|
{
|
||||||
if (delayTime > 0)
|
if (delayBytes > 0)
|
||||||
{
|
{
|
||||||
if ((DateTime.Now - startTime).Ticks < delayTime)
|
if (delayBytes - count < 0)
|
||||||
{
|
{
|
||||||
return count;
|
offset += (int)delayBytes;
|
||||||
|
count -= (int)delayBytes;
|
||||||
|
delayBytes = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
delayTime = 0;
|
else
|
||||||
|
{
|
||||||
|
delayBytes -= count;
|
||||||
|
return count;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
int num = streams[currentStreamIndex].Read(buffer, 0, count);
|
int num = streams[currentStreamIndex].Read(buffer, 0, count);
|
||||||
|
@ -9,7 +9,7 @@
|
|||||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||||
<RootNamespace>CsbBuilder</RootNamespace>
|
<RootNamespace>CsbBuilder</RootNamespace>
|
||||||
<AssemblyName>CsbBuilder</AssemblyName>
|
<AssemblyName>CsbBuilder</AssemblyName>
|
||||||
<TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion>
|
<TargetFrameworkVersion>v4.5.2</TargetFrameworkVersion>
|
||||||
<FileAlignment>512</FileAlignment>
|
<FileAlignment>512</FileAlignment>
|
||||||
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
|
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
|
||||||
<TargetFrameworkProfile />
|
<TargetFrameworkProfile />
|
||||||
@ -228,7 +228,6 @@
|
|||||||
<None Include="Resources\Template_16x.png" />
|
<None Include="Resources\Template_16x.png" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Content Include="NAudio.LICENSE.txt" />
|
|
||||||
<None Include="Resources\Redo_grey_16x.png" />
|
<None Include="Resources\Redo_grey_16x.png" />
|
||||||
<None Include="Resources\Undo_grey_16x.png" />
|
<None Include="Resources\Undo_grey_16x.png" />
|
||||||
<None Include="Resources\Settings_16x.png" />
|
<None Include="Resources\Settings_16x.png" />
|
||||||
@ -236,7 +235,7 @@
|
|||||||
<ItemGroup />
|
<ItemGroup />
|
||||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<PostBuildEvent>copy "$(SolutionDir)Libraries\*.dll" "$(TargetDir)"</PostBuildEvent>
|
<PostBuildEvent>copy "$(SolutionDir)Dependencies\*.dll" "$(TargetDir)"</PostBuildEvent>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
||||||
Other similar extension points exist, see Microsoft.Common.targets.
|
Other similar extension points exist, see Microsoft.Common.targets.
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
</sectionGroup>
|
</sectionGroup>
|
||||||
</configSections>
|
</configSections>
|
||||||
<startup>
|
<startup>
|
||||||
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.1"/>
|
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5.2"/>
|
||||||
</startup>
|
</startup>
|
||||||
<userSettings>
|
<userSettings>
|
||||||
<CsbEditor.Properties.Settings>
|
<CsbEditor.Properties.Settings>
|
||||||
|
@ -9,7 +9,7 @@
|
|||||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||||
<RootNamespace>CsbEditor</RootNamespace>
|
<RootNamespace>CsbEditor</RootNamespace>
|
||||||
<AssemblyName>CsbEditor</AssemblyName>
|
<AssemblyName>CsbEditor</AssemblyName>
|
||||||
<TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion>
|
<TargetFrameworkVersion>v4.5.2</TargetFrameworkVersion>
|
||||||
<FileAlignment>512</FileAlignment>
|
<FileAlignment>512</FileAlignment>
|
||||||
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
|
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
|
||||||
<TargetFrameworkProfile />
|
<TargetFrameworkProfile />
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<configuration>
|
<configuration>
|
||||||
<startup>
|
<startup>
|
||||||
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.1"/>
|
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5.2"/>
|
||||||
</startup>
|
</startup>
|
||||||
</configuration>
|
</configuration>
|
||||||
|
@ -9,7 +9,7 @@
|
|||||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||||
<RootNamespace>SonicAudioCmd</RootNamespace>
|
<RootNamespace>SonicAudioCmd</RootNamespace>
|
||||||
<AssemblyName>SonicAudioCmd</AssemblyName>
|
<AssemblyName>SonicAudioCmd</AssemblyName>
|
||||||
<TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion>
|
<TargetFrameworkVersion>v4.5.2</TargetFrameworkVersion>
|
||||||
<FileAlignment>512</FileAlignment>
|
<FileAlignment>512</FileAlignment>
|
||||||
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
|
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
|
||||||
<TargetFrameworkProfile />
|
<TargetFrameworkProfile />
|
||||||
|
@ -9,7 +9,7 @@
|
|||||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||||
<RootNamespace>SonicAudioLib</RootNamespace>
|
<RootNamespace>SonicAudioLib</RootNamespace>
|
||||||
<AssemblyName>SonicAudioLib</AssemblyName>
|
<AssemblyName>SonicAudioLib</AssemblyName>
|
||||||
<TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion>
|
<TargetFrameworkVersion>v4.5.2</TargetFrameworkVersion>
|
||||||
<FileAlignment>512</FileAlignment>
|
<FileAlignment>512</FileAlignment>
|
||||||
<TargetFrameworkProfile />
|
<TargetFrameworkProfile />
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
Loading…
Reference in New Issue
Block a user