Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MOGG Panning fix for all platforms #480

Merged
merged 1 commit into from
Jun 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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