Skip to content

Commit

Permalink
Fixes XACT ADPCM Compression Playback (MonoGame#7564)
Browse files Browse the repository at this point in the history
Fixes XACT ADPCM Compression Playback
  • Loading branch information
squarebananas authored and viniciusjarina committed Sep 18, 2021
1 parent 9047fc7 commit bd101b4
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion MonoGame.Framework/Platform/Audio/SoundEffect.OpenAL.cs
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ private void PlatformInitializeXact(MiniFormatTag codec, byte[] buffer, int chan
{
if (codec == MiniFormatTag.Adpcm)
{
PlatformInitializeAdpcm(buffer, 0, buffer.Length, sampleRate, (AudioChannels)channels, (blockAlignment + 16) * channels, loopStart, loopLength);
PlatformInitializeAdpcm(buffer, 0, buffer.Length, sampleRate, (AudioChannels)channels, (blockAlignment + 22) * channels, loopStart, loopLength);
duration = TimeSpan.FromSeconds(SoundBuffer.Duration);
return;
}
Expand Down
2 changes: 1 addition & 1 deletion MonoGame.Framework/Platform/Audio/SoundEffect.XAudio.cs
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ private void PlatformInitializeXact(MiniFormatTag codec, byte[] buffer, int chan
{
duration = TimeSpan.FromSeconds((float)loopLength / sampleRate);

CreateBuffers( new WaveFormatAdpcm(sampleRate, channels, blockAlignment),
CreateBuffers( new WaveFormatAdpcm(sampleRate, channels, (blockAlignment + 22) * channels),
ToDataStream(0, buffer, buffer.Length),
loopStart,
loopLength);
Expand Down

0 comments on commit bd101b4

Please sign in to comment.