Skip to content

Commit

Permalink
fix mogg panning on all platforms (YARC-Official#480)
Browse files Browse the repository at this point in the history
  • Loading branch information
RileyTheFox authored Jun 20, 2023
1 parent 732737c commit b78684f
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 13 deletions.
Binary file modified Assets/Plugins/BassNative/Linux/x86_64/libbass.so
Binary file not shown.
Binary file modified Assets/Plugins/BassNative/Mac/libbass.dylib
Binary file not shown.
Binary file modified Assets/Plugins/BassNative/Windows/x86/bass.dll
Binary file not shown.
Binary file modified Assets/Plugins/BassNative/Windows/x86_64/bass.dll
Binary file not shown.
11 changes: 4 additions & 7 deletions Assets/Script/Audio/Bass/BassAudioManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -274,14 +274,11 @@ public void LoadMogg(ExtractedConSongEntry exConSong, float speed, params SongSt

// Initialize stream

#if UNITY_EDITOR_WIN || UNITY_STANDALONE_WIN
// Last flag is new BASS_STREAM_NOREORDER flag, which is not in the BassFlags enum,
// Last flag is new BASS_SAMPLE_NOREORDER flag, which is not in the BassFlags enum,
// as it was made as part of an update to fix <= 8 channel oggs.
const BassFlags flags = BassFlags.Prescan | BassFlags.Decode | BassFlags.AsyncFile | (BassFlags)805306368;
#else
// Currently don't have the new BASS update which has the mogg fix.
const BassFlags flags = BassFlags.Prescan | BassFlags.Decode | BassFlags.AsyncFile;
#endif
// https://www.un4seen.com/forum/?topic=20148.msg140872#msg140872
const BassFlags flags = BassFlags.Prescan | BassFlags.Decode | BassFlags.AsyncFile | (BassFlags)64;

int moggStreamHandle = Bass.CreateStream(moggArray, 0, moggArray.Length, flags);
if (moggStreamHandle == 0) {
Debug.LogError($"Failed to load mogg file or position: {Bass.LastError}");
Expand Down
11 changes: 5 additions & 6 deletions Assets/Script/Audio/Bass/BassStemChannel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -97,12 +97,11 @@ public int Load(float speed) {
return -1;
}

#if UNITY_EDITOR_WIN || UNITY_STANDALONE_WIN
const BassFlags flags = BassFlags.Prescan | BassFlags.Decode | BassFlags.AsyncFile | (BassFlags)805306368;
#else
// Currently don't have the new BASS update which has the mogg fix.
const BassFlags flags = BassFlags.Prescan | BassFlags.Decode | BassFlags.AsyncFile;
#endif
// Last flag is new BASS_SAMPLE_NOREORDER flag, which is not in the BassFlags enum,
// as it was made as part of an update to fix <= 8 channel oggs.
// https://www.un4seen.com/forum/?topic=20148.msg140872#msg140872
const BassFlags flags = BassFlags.Prescan | BassFlags.Decode | BassFlags.AsyncFile | (BassFlags)64;

_sourceHandle = Bass.CreateStream(_path, 0, 0, flags);
if (_sourceHandle == 0) {
return (int) Bass.LastError;
Expand Down

0 comments on commit b78684f

Please sign in to comment.