2021-02-06 18:09:13 -06:00
/ * This file is part of libWiiSharp
* Copyright ( C ) 2009 Leathl
2021-02-06 23:24:10 -06:00
* Copyright ( C ) 2020 - 2021 Github Contributors
2021-02-06 18:09:13 -06:00
*
* libWiiSharp is free software : you can redistribute it and / or
* modify it under the terms of the GNU General Public License as published
* by the Free Software Foundation , either version 3 of the License , or
* ( at your option ) any later version .
*
* libWiiSharp is distributed in the hope that it will be
* useful , but WITHOUT ANY WARRANTY ; without even the implied warranty
* of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE . See the
* GNU General Public License for more details .
*
* You should have received a copy of the GNU General Public License
* along with this program . If not , see < http : //www.gnu.org/licenses/>.
* /
2020-12-28 22:28:44 -06:00
using System ;
using System.IO ;
namespace libWiiSharp
{
2021-02-06 18:09:13 -06:00
internal class BNS_Info
2020-12-28 22:28:44 -06:00
{
2021-02-06 18:09:13 -06:00
//Private Variables
2021-02-06 22:53:40 -06:00
private readonly byte [ ] magic = new byte [ 4 ]
2021-02-06 18:09:13 -06:00
{
2021-02-06 22:53:40 -06:00
73 ,
78 ,
70 ,
79
2021-02-06 18:09:13 -06:00
} ;
private uint size = 160 ;
private byte codec ;
private byte hasLoop ;
private byte channelCount = 2 ;
private byte zero ;
private ushort sampleRate = 44100 ;
private ushort pad0 ;
private uint loopStart ;
private uint loopEnd ; //Or total sample count
private uint offsetToChannelStart = 24 ;
private uint pad1 ;
private uint channel1StartOffset = 32 ;
private uint channel2StartOffset = 44 ;
private uint channel1Start ;
private uint coefficients1Offset = 56 ;
private uint pad2 ;
private uint channel2Start ;
private uint coefficients2Offset = 104 ;
private uint pad3 ;
private int [ ] coefficients1 = new int [ 16 ] ;
private ushort channel1Gain ;
private ushort channel1PredictiveScale ;
private ushort channel1PreviousValue ;
private ushort channel1NextPreviousValue ;
private ushort channel1LoopPredictiveScale ;
private ushort channel1LoopPreviousValue ;
private ushort channel1LoopNextPreviousValue ;
private ushort channel1LoopPadding ;
private int [ ] coefficients2 = new int [ 16 ] ;
private ushort channel2Gain ;
private ushort channel2PredictiveScale ;
private ushort channel2PreviousValue ;
private ushort channel2NextPreviousValue ;
private ushort channel2LoopPredictiveScale ;
private ushort channel2LoopPreviousValue ;
private ushort channel2LoopNextPreviousValue ;
private ushort channel2LoopPadding ;
2020-12-28 22:28:44 -06:00
2021-02-06 18:09:13 -06:00
//Public Variables
public byte HasLoop
{
2021-02-06 22:53:40 -06:00
get = > hasLoop ;
set = > hasLoop = value ;
2021-02-06 18:09:13 -06:00
}
2020-12-28 22:28:44 -06:00
2021-02-06 18:09:13 -06:00
public uint Coefficients1Offset
{
2021-02-06 22:53:40 -06:00
get = > coefficients1Offset ;
set = > coefficients1Offset = value ;
2021-02-06 18:09:13 -06:00
}
2020-12-28 22:28:44 -06:00
2021-02-06 18:09:13 -06:00
public uint Channel1StartOffset
{
2021-02-06 22:53:40 -06:00
get = > channel1StartOffset ;
set = > channel1StartOffset = value ;
2021-02-06 18:09:13 -06:00
}
2020-12-28 22:28:44 -06:00
2021-02-06 18:09:13 -06:00
public uint Channel2StartOffset
{
2021-02-06 22:53:40 -06:00
get = > channel2StartOffset ;
set = > channel2StartOffset = value ;
2021-02-06 18:09:13 -06:00
}
2020-12-28 22:28:44 -06:00
2021-02-06 18:09:13 -06:00
public uint Size
{
2021-02-06 22:53:40 -06:00
get = > size ;
set = > size = value ;
2021-02-06 18:09:13 -06:00
}
2020-12-28 22:28:44 -06:00
2021-02-06 18:09:13 -06:00
public ushort SampleRate
{
2021-02-06 22:53:40 -06:00
get = > sampleRate ;
set = > sampleRate = value ;
2021-02-06 18:09:13 -06:00
}
2020-12-28 22:28:44 -06:00
2021-02-06 18:09:13 -06:00
public byte ChannelCount
{
2021-02-06 22:53:40 -06:00
get = > channelCount ;
set = > channelCount = value ;
2021-02-06 18:09:13 -06:00
}
2020-12-28 22:28:44 -06:00
2021-02-06 18:09:13 -06:00
public uint Channel1Start
{
2021-02-06 22:53:40 -06:00
get = > channel1Start ;
set = > channel1Start = value ;
2021-02-06 18:09:13 -06:00
}
2020-12-28 22:28:44 -06:00
2021-02-06 18:09:13 -06:00
public uint Channel2Start
{
2021-02-06 22:53:40 -06:00
get = > channel2Start ;
set = > channel2Start = value ;
2021-02-06 18:09:13 -06:00
}
2020-12-28 22:28:44 -06:00
2021-02-06 18:09:13 -06:00
public uint LoopStart
{
2021-02-06 22:53:40 -06:00
get = > loopStart ;
set = > loopStart = value ;
2021-02-06 18:09:13 -06:00
}
2020-12-28 22:28:44 -06:00
2021-02-06 18:09:13 -06:00
public uint LoopEnd
{
2021-02-06 22:53:40 -06:00
get = > loopEnd ;
set = > loopEnd = value ;
2021-02-06 18:09:13 -06:00
}
2020-12-28 22:28:44 -06:00
2021-02-06 18:09:13 -06:00
public int [ ] Coefficients1
2020-12-28 22:28:44 -06:00
{
2021-02-06 22:53:40 -06:00
get = > coefficients1 ;
set = > coefficients1 = value ;
2020-12-28 22:28:44 -06:00
}
2021-02-06 18:09:13 -06:00
public int [ ] Coefficients2
2020-12-28 22:28:44 -06:00
{
2021-02-06 22:53:40 -06:00
get = > coefficients2 ;
set = > coefficients2 = value ;
2020-12-28 22:28:44 -06:00
}
2021-02-06 18:09:13 -06:00
public void Write ( Stream outStream )
2020-12-28 22:28:44 -06:00
{
2021-02-06 22:53:40 -06:00
outStream . Write ( magic , 0 , magic . Length ) ;
byte [ ] bytes1 = BitConverter . GetBytes ( size ) ;
Array . Reverse ( bytes1 ) ;
2021-02-06 18:09:13 -06:00
outStream . Write ( bytes1 , 0 , bytes1 . Length ) ;
2021-02-06 22:53:40 -06:00
outStream . WriteByte ( codec ) ;
outStream . WriteByte ( hasLoop ) ;
outStream . WriteByte ( channelCount ) ;
outStream . WriteByte ( zero ) ;
byte [ ] bytes2 = BitConverter . GetBytes ( sampleRate ) ;
Array . Reverse ( bytes2 ) ;
2021-02-06 18:09:13 -06:00
outStream . Write ( bytes2 , 0 , bytes2 . Length ) ;
2021-02-06 22:53:40 -06:00
byte [ ] bytes3 = BitConverter . GetBytes ( pad0 ) ;
Array . Reverse ( bytes3 ) ;
2021-02-06 18:09:13 -06:00
outStream . Write ( bytes3 , 0 , bytes3 . Length ) ;
2021-02-06 22:53:40 -06:00
byte [ ] bytes4 = BitConverter . GetBytes ( loopStart ) ;
Array . Reverse ( bytes4 ) ;
2021-02-06 18:09:13 -06:00
outStream . Write ( bytes4 , 0 , bytes4 . Length ) ;
2021-02-06 22:53:40 -06:00
byte [ ] bytes5 = BitConverter . GetBytes ( loopEnd ) ;
Array . Reverse ( bytes5 ) ;
2021-02-06 18:09:13 -06:00
outStream . Write ( bytes5 , 0 , bytes5 . Length ) ;
2021-02-06 22:53:40 -06:00
byte [ ] bytes6 = BitConverter . GetBytes ( offsetToChannelStart ) ;
Array . Reverse ( bytes6 ) ;
2021-02-06 18:09:13 -06:00
outStream . Write ( bytes6 , 0 , bytes6 . Length ) ;
2021-02-06 22:53:40 -06:00
byte [ ] bytes7 = BitConverter . GetBytes ( pad1 ) ;
Array . Reverse ( bytes7 ) ;
2021-02-06 18:09:13 -06:00
outStream . Write ( bytes7 , 0 , bytes7 . Length ) ;
2021-02-06 22:53:40 -06:00
byte [ ] bytes8 = BitConverter . GetBytes ( channel1StartOffset ) ;
Array . Reverse ( bytes8 ) ;
2021-02-06 18:09:13 -06:00
outStream . Write ( bytes8 , 0 , bytes8 . Length ) ;
2021-02-06 22:53:40 -06:00
byte [ ] bytes9 = BitConverter . GetBytes ( channel2StartOffset ) ;
Array . Reverse ( bytes9 ) ;
2021-02-06 18:09:13 -06:00
outStream . Write ( bytes9 , 0 , bytes9 . Length ) ;
2021-02-06 22:53:40 -06:00
byte [ ] bytes10 = BitConverter . GetBytes ( channel1Start ) ;
Array . Reverse ( bytes10 ) ;
2021-02-06 18:09:13 -06:00
outStream . Write ( bytes10 , 0 , bytes10 . Length ) ;
2021-02-06 22:53:40 -06:00
byte [ ] bytes11 = BitConverter . GetBytes ( coefficients1Offset ) ;
Array . Reverse ( bytes11 ) ;
2021-02-06 18:09:13 -06:00
outStream . Write ( bytes11 , 0 , bytes11 . Length ) ;
2021-02-06 22:53:40 -06:00
if ( channelCount = = 2 )
2021-02-06 18:09:13 -06:00
{
2021-02-06 22:53:40 -06:00
byte [ ] bytes12 = BitConverter . GetBytes ( pad2 ) ;
Array . Reverse ( bytes12 ) ;
2021-02-06 18:09:13 -06:00
outStream . Write ( bytes12 , 0 , bytes12 . Length ) ;
2021-02-06 22:53:40 -06:00
byte [ ] bytes13 = BitConverter . GetBytes ( channel2Start ) ;
Array . Reverse ( bytes13 ) ;
2021-02-06 18:09:13 -06:00
outStream . Write ( bytes13 , 0 , bytes13 . Length ) ;
2021-02-06 22:53:40 -06:00
byte [ ] bytes14 = BitConverter . GetBytes ( coefficients2Offset ) ;
Array . Reverse ( bytes14 ) ;
2021-02-06 18:09:13 -06:00
outStream . Write ( bytes14 , 0 , bytes14 . Length ) ;
2021-02-06 22:53:40 -06:00
byte [ ] bytes15 = BitConverter . GetBytes ( pad3 ) ;
Array . Reverse ( bytes15 ) ;
2021-02-06 18:09:13 -06:00
outStream . Write ( bytes15 , 0 , bytes15 . Length ) ;
2021-02-06 22:53:40 -06:00
foreach ( int num in coefficients1 )
2021-02-06 18:09:13 -06:00
{
byte [ ] bytes16 = BitConverter . GetBytes ( num ) ;
2021-02-06 22:53:40 -06:00
Array . Reverse ( bytes16 ) ;
2021-02-06 18:09:13 -06:00
outStream . Write ( bytes16 , 2 , bytes16 . Length - 2 ) ;
}
2021-02-06 22:53:40 -06:00
byte [ ] bytes17 = BitConverter . GetBytes ( channel1Gain ) ;
Array . Reverse ( bytes17 ) ;
2021-02-06 18:09:13 -06:00
outStream . Write ( bytes17 , 0 , bytes17 . Length ) ;
2021-02-06 22:53:40 -06:00
byte [ ] bytes18 = BitConverter . GetBytes ( channel1PredictiveScale ) ;
Array . Reverse ( bytes18 ) ;
2021-02-06 18:09:13 -06:00
outStream . Write ( bytes18 , 0 , bytes18 . Length ) ;
2021-02-06 22:53:40 -06:00
byte [ ] bytes19 = BitConverter . GetBytes ( channel1PreviousValue ) ;
Array . Reverse ( bytes19 ) ;
2021-02-06 18:09:13 -06:00
outStream . Write ( bytes19 , 0 , bytes19 . Length ) ;
2021-02-06 22:53:40 -06:00
byte [ ] bytes20 = BitConverter . GetBytes ( channel1NextPreviousValue ) ;
Array . Reverse ( bytes20 ) ;
2021-02-06 18:09:13 -06:00
outStream . Write ( bytes20 , 0 , bytes20 . Length ) ;
2021-02-06 22:53:40 -06:00
byte [ ] bytes21 = BitConverter . GetBytes ( channel1LoopPredictiveScale ) ;
Array . Reverse ( bytes21 ) ;
2021-02-06 18:09:13 -06:00
outStream . Write ( bytes21 , 0 , bytes21 . Length ) ;
2021-02-06 22:53:40 -06:00
byte [ ] bytes22 = BitConverter . GetBytes ( channel1LoopPreviousValue ) ;
Array . Reverse ( bytes22 ) ;
2021-02-06 18:09:13 -06:00
outStream . Write ( bytes22 , 0 , bytes22 . Length ) ;
2021-02-06 22:53:40 -06:00
byte [ ] bytes23 = BitConverter . GetBytes ( channel1LoopNextPreviousValue ) ;
Array . Reverse ( bytes23 ) ;
2021-02-06 18:09:13 -06:00
outStream . Write ( bytes23 , 0 , bytes23 . Length ) ;
2021-02-06 22:53:40 -06:00
byte [ ] bytes24 = BitConverter . GetBytes ( channel1LoopPadding ) ;
Array . Reverse ( bytes24 ) ;
2021-02-06 18:09:13 -06:00
outStream . Write ( bytes24 , 0 , bytes24 . Length ) ;
2021-02-06 22:53:40 -06:00
foreach ( int num in coefficients2 )
2021-02-06 18:09:13 -06:00
{
byte [ ] bytes16 = BitConverter . GetBytes ( num ) ;
2021-02-06 22:53:40 -06:00
Array . Reverse ( bytes16 ) ;
2021-02-06 18:09:13 -06:00
outStream . Write ( bytes16 , 2 , bytes16 . Length - 2 ) ;
}
2021-02-06 22:53:40 -06:00
byte [ ] bytes25 = BitConverter . GetBytes ( channel2Gain ) ;
Array . Reverse ( bytes25 ) ;
2021-02-06 18:09:13 -06:00
outStream . Write ( bytes25 , 0 , bytes25 . Length ) ;
2021-02-06 22:53:40 -06:00
byte [ ] bytes26 = BitConverter . GetBytes ( channel2PredictiveScale ) ;
Array . Reverse ( bytes26 ) ;
2021-02-06 18:09:13 -06:00
outStream . Write ( bytes26 , 0 , bytes26 . Length ) ;
2021-02-06 22:53:40 -06:00
byte [ ] bytes27 = BitConverter . GetBytes ( channel2PreviousValue ) ;
Array . Reverse ( bytes27 ) ;
2021-02-06 18:09:13 -06:00
outStream . Write ( bytes27 , 0 , bytes27 . Length ) ;
2021-02-06 22:53:40 -06:00
byte [ ] bytes28 = BitConverter . GetBytes ( channel2NextPreviousValue ) ;
Array . Reverse ( bytes28 ) ;
2021-02-06 18:09:13 -06:00
outStream . Write ( bytes28 , 0 , bytes28 . Length ) ;
2021-02-06 22:53:40 -06:00
byte [ ] bytes29 = BitConverter . GetBytes ( channel2LoopPredictiveScale ) ;
Array . Reverse ( bytes29 ) ;
2021-02-06 18:09:13 -06:00
outStream . Write ( bytes29 , 0 , bytes29 . Length ) ;
2021-02-06 22:53:40 -06:00
byte [ ] bytes30 = BitConverter . GetBytes ( channel2LoopPreviousValue ) ;
Array . Reverse ( bytes30 ) ;
2021-02-06 18:09:13 -06:00
outStream . Write ( bytes30 , 0 , bytes30 . Length ) ;
2021-02-06 22:53:40 -06:00
byte [ ] bytes31 = BitConverter . GetBytes ( channel2LoopNextPreviousValue ) ;
Array . Reverse ( bytes31 ) ;
2021-02-06 18:09:13 -06:00
outStream . Write ( bytes31 , 0 , bytes31 . Length ) ;
2021-02-06 22:53:40 -06:00
byte [ ] bytes32 = BitConverter . GetBytes ( channel2LoopPadding ) ;
Array . Reverse ( bytes32 ) ;
2021-02-06 18:09:13 -06:00
outStream . Write ( bytes32 , 0 , bytes32 . Length ) ;
}
else
{
2021-02-06 22:53:40 -06:00
if ( channelCount ! = 1 )
{
2021-02-06 18:09:13 -06:00
return ;
2021-02-06 22:53:40 -06:00
}
foreach ( int num in coefficients1 )
2021-02-06 18:09:13 -06:00
{
byte [ ] bytes12 = BitConverter . GetBytes ( num ) ;
2021-02-06 22:53:40 -06:00
Array . Reverse ( bytes12 ) ;
2021-02-06 18:09:13 -06:00
outStream . Write ( bytes12 , 2 , bytes12 . Length - 2 ) ;
}
2021-02-06 22:53:40 -06:00
byte [ ] bytes13 = BitConverter . GetBytes ( channel1Gain ) ;
Array . Reverse ( bytes13 ) ;
2021-02-06 18:09:13 -06:00
outStream . Write ( bytes13 , 0 , bytes13 . Length ) ;
2021-02-06 22:53:40 -06:00
byte [ ] bytes14 = BitConverter . GetBytes ( channel1PredictiveScale ) ;
Array . Reverse ( bytes14 ) ;
2021-02-06 18:09:13 -06:00
outStream . Write ( bytes14 , 0 , bytes14 . Length ) ;
2021-02-06 22:53:40 -06:00
byte [ ] bytes15 = BitConverter . GetBytes ( channel1PreviousValue ) ;
Array . Reverse ( bytes15 ) ;
2021-02-06 18:09:13 -06:00
outStream . Write ( bytes15 , 0 , bytes15 . Length ) ;
2021-02-06 22:53:40 -06:00
byte [ ] bytes16 = BitConverter . GetBytes ( channel1NextPreviousValue ) ;
Array . Reverse ( bytes16 ) ;
2021-02-06 18:09:13 -06:00
outStream . Write ( bytes16 , 0 , bytes16 . Length ) ;
2021-02-06 22:53:40 -06:00
byte [ ] bytes17 = BitConverter . GetBytes ( channel1LoopPredictiveScale ) ;
Array . Reverse ( bytes17 ) ;
2021-02-06 18:09:13 -06:00
outStream . Write ( bytes17 , 0 , bytes17 . Length ) ;
2021-02-06 22:53:40 -06:00
byte [ ] bytes18 = BitConverter . GetBytes ( channel1LoopPreviousValue ) ;
Array . Reverse ( bytes18 ) ;
2021-02-06 18:09:13 -06:00
outStream . Write ( bytes18 , 0 , bytes18 . Length ) ;
2021-02-06 22:53:40 -06:00
byte [ ] bytes19 = BitConverter . GetBytes ( channel1LoopNextPreviousValue ) ;
Array . Reverse ( bytes19 ) ;
2021-02-06 18:09:13 -06:00
outStream . Write ( bytes19 , 0 , bytes19 . Length ) ;
2021-02-06 22:53:40 -06:00
byte [ ] bytes20 = BitConverter . GetBytes ( channel1LoopPadding ) ;
Array . Reverse ( bytes20 ) ;
2021-02-06 18:09:13 -06:00
outStream . Write ( bytes20 , 0 , bytes20 . Length ) ;
}
2020-12-28 22:28:44 -06:00
}
2021-02-06 18:09:13 -06:00
public void Read ( Stream input )
{
BinaryReader binaryReader = new BinaryReader ( input ) ;
2021-02-06 22:53:40 -06:00
size = Shared . CompareByteArrays ( magic , binaryReader . ReadBytes ( 4 ) ) ? Shared . Swap ( binaryReader . ReadUInt32 ( ) ) : throw new Exception ( "This is not a valid BNS audfo file!" ) ;
codec = binaryReader . ReadByte ( ) ;
hasLoop = binaryReader . ReadByte ( ) ;
channelCount = binaryReader . ReadByte ( ) ;
zero = binaryReader . ReadByte ( ) ;
sampleRate = Shared . Swap ( binaryReader . ReadUInt16 ( ) ) ;
pad0 = Shared . Swap ( binaryReader . ReadUInt16 ( ) ) ;
loopStart = Shared . Swap ( binaryReader . ReadUInt32 ( ) ) ;
loopEnd = Shared . Swap ( binaryReader . ReadUInt32 ( ) ) ;
offsetToChannelStart = Shared . Swap ( binaryReader . ReadUInt32 ( ) ) ;
pad1 = Shared . Swap ( binaryReader . ReadUInt32 ( ) ) ;
channel1StartOffset = Shared . Swap ( binaryReader . ReadUInt32 ( ) ) ;
channel2StartOffset = Shared . Swap ( binaryReader . ReadUInt32 ( ) ) ;
channel1Start = Shared . Swap ( binaryReader . ReadUInt32 ( ) ) ;
coefficients1Offset = Shared . Swap ( binaryReader . ReadUInt32 ( ) ) ;
if ( channelCount = = 2 )
2021-02-06 18:09:13 -06:00
{
2021-02-06 22:53:40 -06:00
pad2 = Shared . Swap ( binaryReader . ReadUInt32 ( ) ) ;
channel2Start = Shared . Swap ( binaryReader . ReadUInt32 ( ) ) ;
coefficients2Offset = Shared . Swap ( binaryReader . ReadUInt32 ( ) ) ;
pad3 = Shared . Swap ( binaryReader . ReadUInt32 ( ) ) ;
2021-02-06 18:09:13 -06:00
for ( int index = 0 ; index < 16 ; + + index )
2021-02-06 22:53:40 -06:00
{
coefficients1 [ index ] = ( short ) Shared . Swap ( binaryReader . ReadUInt16 ( ) ) ;
}
channel1Gain = Shared . Swap ( binaryReader . ReadUInt16 ( ) ) ;
channel1PredictiveScale = Shared . Swap ( binaryReader . ReadUInt16 ( ) ) ;
channel1PreviousValue = Shared . Swap ( binaryReader . ReadUInt16 ( ) ) ;
channel1NextPreviousValue = Shared . Swap ( binaryReader . ReadUInt16 ( ) ) ;
channel1LoopPredictiveScale = Shared . Swap ( binaryReader . ReadUInt16 ( ) ) ;
channel1LoopPreviousValue = Shared . Swap ( binaryReader . ReadUInt16 ( ) ) ;
channel1LoopNextPreviousValue = Shared . Swap ( binaryReader . ReadUInt16 ( ) ) ;
channel1LoopPadding = Shared . Swap ( binaryReader . ReadUInt16 ( ) ) ;
2021-02-06 18:09:13 -06:00
for ( int index = 0 ; index < 16 ; + + index )
2021-02-06 22:53:40 -06:00
{
coefficients2 [ index ] = ( short ) Shared . Swap ( binaryReader . ReadUInt16 ( ) ) ;
}
channel2Gain = Shared . Swap ( binaryReader . ReadUInt16 ( ) ) ;
channel2PredictiveScale = Shared . Swap ( binaryReader . ReadUInt16 ( ) ) ;
channel2PreviousValue = Shared . Swap ( binaryReader . ReadUInt16 ( ) ) ;
channel2NextPreviousValue = Shared . Swap ( binaryReader . ReadUInt16 ( ) ) ;
channel2LoopPredictiveScale = Shared . Swap ( binaryReader . ReadUInt16 ( ) ) ;
channel2LoopPreviousValue = Shared . Swap ( binaryReader . ReadUInt16 ( ) ) ;
channel2LoopNextPreviousValue = Shared . Swap ( binaryReader . ReadUInt16 ( ) ) ;
channel2LoopPadding = Shared . Swap ( binaryReader . ReadUInt16 ( ) ) ;
2021-02-06 18:09:13 -06:00
}
else
{
2021-02-06 22:53:40 -06:00
if ( channelCount ! = 1 )
{
2021-02-06 18:09:13 -06:00
return ;
2021-02-06 22:53:40 -06:00
}
2021-02-06 18:09:13 -06:00
for ( int index = 0 ; index < 16 ; + + index )
2021-02-06 22:53:40 -06:00
{
coefficients1 [ index ] = ( short ) Shared . Swap ( binaryReader . ReadUInt16 ( ) ) ;
}
channel1Gain = Shared . Swap ( binaryReader . ReadUInt16 ( ) ) ;
channel1PredictiveScale = Shared . Swap ( binaryReader . ReadUInt16 ( ) ) ;
channel1PreviousValue = Shared . Swap ( binaryReader . ReadUInt16 ( ) ) ;
channel1NextPreviousValue = Shared . Swap ( binaryReader . ReadUInt16 ( ) ) ;
channel1LoopPredictiveScale = Shared . Swap ( binaryReader . ReadUInt16 ( ) ) ;
channel1LoopPreviousValue = Shared . Swap ( binaryReader . ReadUInt16 ( ) ) ;
channel1LoopNextPreviousValue = Shared . Swap ( binaryReader . ReadUInt16 ( ) ) ;
channel1LoopPadding = Shared . Swap ( binaryReader . ReadUInt16 ( ) ) ;
2021-02-06 18:09:13 -06:00
}
}
2020-12-28 22:28:44 -06:00
}
}