From 4ff82e578649730f10ec8497ff72d91ba7aaba89 Mon Sep 17 00:00:00 2001 From: Stevo John Date: Fri, 16 Aug 2024 16:24:29 +0100 Subject: [PATCH 1/5] Removed NuGet --- .../Modules/Audio/Engines/Bass/BassFlag.cs | 269 ++++++++++++++++++ .../Modules/Audio/Engines/Bass/BassInit.cs | 52 ++++ .../Modules/Audio/Engines/Bass/BassSync.cs | 43 +++ .../Modules/Audio/Engines/Bass/ManagedBass.cs | 33 +++ .../Modules/Audio/Engines/BassAudioEngine.cs | 16 +- src/Zen.System/Zen.System.csproj | 1 - 6 files changed, 405 insertions(+), 9 deletions(-) create mode 100644 src/Zen.System/Modules/Audio/Engines/Bass/BassFlag.cs create mode 100644 src/Zen.System/Modules/Audio/Engines/Bass/BassInit.cs create mode 100644 src/Zen.System/Modules/Audio/Engines/Bass/BassSync.cs create mode 100644 src/Zen.System/Modules/Audio/Engines/Bass/ManagedBass.cs diff --git a/src/Zen.System/Modules/Audio/Engines/Bass/BassFlag.cs b/src/Zen.System/Modules/Audio/Engines/Bass/BassFlag.cs new file mode 100644 index 00000000..68c9bfcd --- /dev/null +++ b/src/Zen.System/Modules/Audio/Engines/Bass/BassFlag.cs @@ -0,0 +1,269 @@ +// ReSharper disable InconsistentNaming +// ReSharper disable IdentifierTypo +// ReSharper disable UnusedMember.Global +namespace Zen.System.Modules.Audio.Engines.Bass; + +[Flags] +public enum BassFlag +{ + BASS_DEFAULT = 0, + BASS_SAMPLE_8BITS = 1, + BASS_SAMPLE_MONO = 2, + BASS_SAMCHAN_NEW = BASS_SAMPLE_8BITS, // 0x00000001 + BASS_SAMCHAN_STREAM = BASS_SAMPLE_MONO, // 0x00000002 + BASS_SAMPLE_LOOP = 4, + BASS_SAMPLE_3D = 8, + BASS_SAMPLE_SOFTWARE = 16, // 0x00000010 + BASS_SAMPLE_MUTEMAX = 32, // 0x00000020 + BASS_SAMPLE_VAM = 64, // 0x00000040 + BASS_SAMPLE_FX = 128, // 0x00000080 + BASS_SAMPLE_FLOAT = 256, // 0x00000100 + BASS_RECORD_PAUSE = 32768, // 0x00008000 + BASS_RECORD_ECHOCANCEL = 8192, // 0x00002000 + BASS_RECORD_AGC = 16384, // 0x00004000 + BASS_STREAM_PRESCAN = 131072, // 0x00020000 + BASS_STREAM_AUTOFREE = 262144, // 0x00040000 + BASS_STREAM_RESTRATE = 524288, // 0x00080000 + BASS_STREAM_BLOCK = 1048576, // 0x00100000 + BASS_STREAM_DECODE = 2097152, // 0x00200000 + BASS_STREAM_STATUS = 8388608, // 0x00800000 + BASS_SPEAKER_FRONT = 16777216, // 0x01000000 + BASS_SPEAKER_REAR = 33554432, // 0x02000000 + BASS_SPEAKER_CENLFE = BASS_SPEAKER_REAR | BASS_SPEAKER_FRONT, // 0x03000000 + BASS_SPEAKER_REAR2 = 67108864, // 0x04000000 + BASS_SPEAKER_SIDE = BASS_SPEAKER_REAR2, // 0x04000000 + BASS_SPEAKER_LEFT = 268435456, // 0x10000000 + BASS_SPEAKER_RIGHT = 536870912, // 0x20000000 + BASS_SPEAKER_FRONTLEFT = BASS_SPEAKER_LEFT | BASS_SPEAKER_FRONT, // 0x11000000 + BASS_SPEAKER_FRONTRIGHT = BASS_SPEAKER_RIGHT | BASS_SPEAKER_FRONT, // 0x21000000 + BASS_SPEAKER_REARLEFT = BASS_SPEAKER_LEFT | BASS_SPEAKER_REAR, // 0x12000000 + BASS_SPEAKER_REARRIGHT = BASS_SPEAKER_RIGHT | BASS_SPEAKER_REAR, // 0x22000000 + BASS_SPEAKER_CENTER = BASS_SPEAKER_REARLEFT | BASS_SPEAKER_FRONT, // 0x13000000 + BASS_SPEAKER_LFE = BASS_SPEAKER_REARRIGHT | BASS_SPEAKER_FRONT, // 0x23000000 + BASS_SPEAKER_SIDELEFT = BASS_SPEAKER_LEFT | BASS_SPEAKER_SIDE, // 0x14000000 + BASS_SPEAKER_SIDERIGHT = BASS_SPEAKER_RIGHT | BASS_SPEAKER_SIDE, // 0x24000000 + BASS_SPEAKER_REAR2LEFT = BASS_SPEAKER_SIDELEFT, // 0x14000000 + BASS_SPEAKER_REAR2RIGHT = BASS_SPEAKER_SIDERIGHT, // 0x24000000 + BASS_SPEAKER_PAIR1 = BASS_SPEAKER_FRONT, // 0x01000000 + BASS_SPEAKER_PAIR2 = BASS_SPEAKER_REAR, // 0x02000000 + BASS_SPEAKER_PAIR3 = BASS_SPEAKER_PAIR2 | BASS_SPEAKER_PAIR1, // 0x03000000 + BASS_SPEAKER_PAIR4 = BASS_SPEAKER_SIDE, // 0x04000000 + BASS_SPEAKER_PAIR5 = BASS_SPEAKER_PAIR4 | BASS_SPEAKER_PAIR1, // 0x05000000 + BASS_SPEAKER_PAIR6 = BASS_SPEAKER_PAIR4 | BASS_SPEAKER_PAIR2, // 0x06000000 + BASS_SPEAKER_PAIR7 = BASS_SPEAKER_PAIR6 | BASS_SPEAKER_PAIR1, // 0x07000000 + BASS_SPEAKER_PAIR8 = 134217728, // 0x08000000 + BASS_SPEAKER_PAIR9 = BASS_SPEAKER_PAIR8 | BASS_SPEAKER_PAIR1, // 0x09000000 + BASS_SPEAKER_PAIR10 = BASS_SPEAKER_PAIR8 | BASS_SPEAKER_PAIR2, // 0x0A000000 + BASS_SPEAKER_PAIR11 = BASS_SPEAKER_PAIR10 | BASS_SPEAKER_PAIR1, // 0x0B000000 + BASS_SPEAKER_PAIR12 = BASS_SPEAKER_PAIR8 | BASS_SPEAKER_PAIR4, // 0x0C000000 + BASS_SPEAKER_PAIR13 = BASS_SPEAKER_PAIR12 | BASS_SPEAKER_PAIR1, // 0x0D000000 + BASS_SPEAKER_PAIR14 = BASS_SPEAKER_PAIR12 | BASS_SPEAKER_PAIR2, // 0x0E000000 + BASS_SPEAKER_PAIR15 = BASS_SPEAKER_PAIR14 | BASS_SPEAKER_PAIR1, // 0x0F000000 + BASS_ASYNCFILE = 1073741824, // 0x40000000 + BASS_UNICODE = -2147483648, // 0x80000000 + BASS_SAMPLE_OVER_VOL = 65536, // 0x00010000 + BASS_SAMPLE_OVER_POS = BASS_STREAM_PRESCAN, // 0x00020000 + BASS_SAMPLE_OVER_DIST = BASS_SAMPLE_OVER_POS | BASS_SAMPLE_OVER_VOL, // 0x00030000 + BASS_WV_STEREO = 4194304, // 0x00400000 + BASS_AC3_DOWNMIX_2 = 512, // 0x00000200 + BASS_AC3_DOWNMIX_4 = 1024, // 0x00000400 + BASS_DSD_RAW = BASS_AC3_DOWNMIX_2, // 0x00000200 + BASS_DSD_DOP = BASS_AC3_DOWNMIX_4, // 0x00000400 + BASS_DSD_DOP_AA = 2048, // 0x00000800 + BASS_AC3_DOWNMIX_DOLBY = BASS_DSD_DOP | BASS_DSD_RAW, // 0x00000600 + BASS_AC3_DYNAMIC_RANGE = BASS_DSD_DOP_AA, // 0x00000800 + BASS_AAC_FRAME960 = 4096, // 0x00001000 + BASS_AAC_STEREO = BASS_WV_STEREO, // 0x00400000 + BASS_MIXER_END = BASS_SAMPLE_OVER_VOL, // 0x00010000 + BASS_MIXER_CHAN_PAUSE = BASS_SAMPLE_OVER_POS, // 0x00020000 + BASS_MIXER_NONSTOP = BASS_MIXER_CHAN_PAUSE, // 0x00020000 + BASS_MIXER_RESUME = BASS_AAC_FRAME960, // 0x00001000 + BASS_MIXER_CHAN_ABSOLUTE = BASS_MIXER_RESUME, // 0x00001000 + BASS_MIXER_POSEX = BASS_RECORD_ECHOCANCEL, // 0x00002000 + BASS_MIXER_NOSPEAKER = BASS_RECORD_AGC, // 0x00004000 + BASS_MIXER_CHAN_LIMIT = BASS_MIXER_NOSPEAKER, // 0x00004000 + BASS_MIXER_LIMIT = BASS_MIXER_CHAN_LIMIT, // 0x00004000 + BASS_MIXER_QUEUE = BASS_RECORD_PAUSE, // 0x00008000 + BASS_MIXER_CHAN_MATRIX = BASS_MIXER_END, // 0x00010000 + BASS_MIXER_MATRIX = BASS_MIXER_CHAN_MATRIX, // 0x00010000 + BASS_MIXER_CHAN_DOWNMIX = BASS_AAC_STEREO, // 0x00400000 + BASS_MIXER_CHAN_NORAMPIN = BASS_STREAM_STATUS, // 0x00800000 + BASS_MIXER_NORAMPIN = BASS_MIXER_CHAN_NORAMPIN, // 0x00800000 + BASS_SPLIT_SLAVE = BASS_MIXER_CHAN_ABSOLUTE, // 0x00001000 + BASS_MIXER_CHAN_BUFFER = BASS_MIXER_POSEX, // 0x00002000 + BASS_MIXER_BUFFER = BASS_MIXER_CHAN_BUFFER, // 0x00002000 + BASS_SPLIT_POS = BASS_MIXER_BUFFER, // 0x00002000 + BASS_CD_SUBCHANNEL = BASS_DSD_RAW, // 0x00000200 + BASS_CD_SUBCHANNEL_NOHW = BASS_DSD_DOP, // 0x00000400 + BASS_CD_C2ERRORS = BASS_AC3_DYNAMIC_RANGE, // 0x00000800 + BASS_MIDI_NODRUMPARAM = BASS_CD_SUBCHANNEL_NOHW, // 0x00000400 + BASS_MIDI_NOSYSRESET = BASS_CD_C2ERRORS, // 0x00000800 + BASS_MIDI_DECAYEND = BASS_SPLIT_SLAVE, // 0x00001000 + BASS_MIDI_NOFX = BASS_SPLIT_POS, // 0x00002000 + BASS_MIDI_DECAYSEEK = BASS_MIXER_LIMIT, // 0x00004000 + BASS_MIDI_NOCROP = BASS_MIXER_QUEUE, // 0x00008000 + BASS_MIDI_NOTEOFF1 = BASS_MIXER_MATRIX, // 0x00010000 + BASS_MIDI_ASYNC = BASS_MIXER_CHAN_DOWNMIX, // 0x00400000 + BASS_MIDI_SINCINTER = BASS_MIXER_NORAMPIN, // 0x00800000 + BASS_MIDI_FONT_MEM = BASS_MIDI_NOTEOFF1, // 0x00010000 + BASS_MIDI_FONT_MMAP = BASS_MIXER_NONSTOP, // 0x00020000 + BASS_MIDI_FONT_XGDRUMS = BASS_STREAM_AUTOFREE, // 0x00040000 + BASS_MIDI_FONT_NOFX = BASS_STREAM_RESTRATE, // 0x00080000 + BASS_MIDI_FONT_LINATTMOD = BASS_STREAM_BLOCK, // 0x00100000 + BASS_MIDI_FONT_LINDECVOL = BASS_STREAM_DECODE, // 0x00200000 + BASS_MIDI_FONT_NORAMPIN = BASS_MIDI_ASYNC, // 0x00400000 + BASS_MIDI_FONT_NOLIMITS = BASS_MIDI_SINCINTER, // 0x00800000 + + /// + /// BASSMIDI add-on: Treat the reverb/chorus levels in the soundfont as minimums. The higher of them and the MIDI levels (CC91/93) will be used instead of the sum of both. + /// + BASS_MIDI_FONT_MINFX = BASS_SPEAKER_PAIR1, // 0x01000000 + + /// + /// BASSMIDI add-on: Don't send a WAVE header to the encoder. If this flag is used then the sample format (mono 16-bit) must be passed to the encoder some other way, eg. via the command-line. + /// + BASS_MIDI_PACK_NOHEAD = BASS_SAMCHAN_NEW, // 0x00000001 + + /// + /// BASSMIDI add-on: Reduce 24-bit sample data to 16-bit before encoding. + /// + BASS_MIDI_PACK_16BIT = BASS_SAMCHAN_STREAM, // 0x00000002 + + /// + /// BASSMIDI add-on: Set encoding rate to 48000 Hz (else 44100 Hz). + /// + BASS_MIDI_PACK_48KHZ = BASS_SAMPLE_LOOP, // 0x00000004 + + /// BASS_FX add-on: Free the source handle as well? + BASS_FX_FREESOURCE = BASS_MIDI_FONT_MEM, // 0x00010000 + + /// + /// BASS_FX add-on: If in use, then you can do other stuff while detection's in process. + /// + BASS_FX_BPM_BKGRND = BASS_MIDI_PACK_NOHEAD, // 0x00000001 + + /// + /// BASS_FX add-on: If in use, then will auto multiply bpm by 2 (if BPM < MinBPM*2) + /// + BASS_FX_BPM_MULT2 = BASS_MIDI_PACK_16BIT, // 0x00000002 + + /// + /// BASS_FX add-on (AddOn.Fx.BassFx.BASS_FX_TempoCreate): Uses a linear interpolation mode (simple). + /// + BASS_FX_TEMPO_ALGO_LINEAR = BASS_CD_SUBCHANNEL, // 0x00000200 + + /// + /// BASS_FX add-on (AddOn.Fx.BassFx.BASS_FX_TempoCreate): Uses a cubic interpolation mode (recommended, default). + /// + BASS_FX_TEMPO_ALGO_CUBIC = BASS_MIDI_NODRUMPARAM, // 0x00000400 + + /// + /// BASS_FX add-on (AddOn.Fx.BassFx.BASS_FX_TempoCreate): Uses a 8-tap band-limited Shannon interpolation (complex, but not much better than cubic). + /// + BASS_FX_TEMPO_ALGO_SHANNON = BASS_MIDI_NOSYSRESET, // 0x00000800 + + /// + /// Music: Use 32-bit floating-point sample data (see Floating-Point Channels for details). WDM drivers or the BASS_STREAM_DECODE flag are required to use this flag. + /// + BASS_MUSIC_FLOAT = BASS_SAMPLE_FLOAT, // 0x00000100 + + /// + /// Music: Decode/play the mod music in mono, reducing the CPU usage (if it was originally stereo). + /// This flag is automatically applied if BASS_DEVICE_MONO was specified when calling . + /// + BASS_MUSIC_MONO = BASS_FX_BPM_MULT2, // 0x00000002 + + /// + /// Music: Loop the music. This flag can be toggled at any time using . + /// + BASS_MUSIC_LOOP = BASS_MIDI_PACK_48KHZ, // 0x00000004 + + /// + /// Music: Use 3D functionality. This is ignored if BASS_DEVICE_3D wasn't specified when calling . + /// 3D streams must be mono (chans=1). The SPEAKER flags can not be used together with this flag. + /// + BASS_MUSIC_3D = BASS_SAMPLE_3D, // 0x00000008 + + /// + /// Music: Enable the old implementation of DirectX 8 effects. See the DX8 effect implementations section for details. + /// Use to add effects to the stream. Requires DirectX 8 or above. + /// + BASS_MUSIC_FX = BASS_SAMPLE_FX, // 0x00000080 + + /// + /// Music: Automatically free the music when it ends. This allows you to play a music and forget about it, as BASS will automatically free the music's resources when it has reached the end or when (or ) is called. + /// Note that some musics never actually end on their own (ie. without you stopping them). + /// + BASS_MUSIC_AUTOFREE = BASS_MIDI_FONT_XGDRUMS, // 0x00040000 + + /// + /// Music: Decode the music into sample data, without outputting it. + /// Use to retrieve decoded sample data. + /// BASS_SAMPLE_SOFTWARE/3D/FX/AUTOFREE are ignored when using this flag, as are the SPEAKER flags. + /// + BASS_MUSIC_DECODE = BASS_MIDI_FONT_LINDECVOL, // 0x00200000 + + /// + /// Music: Calculate the playback length of the music, and enable seeking in bytes. This slightly increases the time taken to load the music, depending on how long it is. + /// In the case of musics that loop, the length until the loop occurs is calculated. Use to retrieve the length. + /// + BASS_MUSIC_PRESCAN = BASS_MIDI_FONT_MMAP, // 0x00020000 + + /// + /// Music: Use "normal" ramping (as used in FastTracker 2). + /// + BASS_MUSIC_RAMP = BASS_FX_TEMPO_ALGO_LINEAR, // 0x00000200 + + /// Music: Use "sensitive" ramping. + BASS_MUSIC_RAMPS = BASS_FX_TEMPO_ALGO_CUBIC, // 0x00000400 + + /// + /// Music: Apply XMPlay's surround sound to the music (ignored in mono). + /// + BASS_MUSIC_SURROUND = BASS_FX_TEMPO_ALGO_SHANNON, // 0x00000800 + + /// + /// Music: Apply XMPlay's surround sound mode 2 to the music (ignored in mono). + /// + BASS_MUSIC_SURROUND2 = BASS_MIDI_DECAYEND, // 0x00001000 + + /// Music: Apply FastTracker 2 panning to XM files. + BASS_MUSIC_FT2PAN = BASS_MIDI_NOFX, // 0x00002000 + + /// Music: Play .MOD file as FastTracker 2 would. + BASS_MUSIC_FT2MOD = BASS_MUSIC_FT2PAN, // 0x00002000 + + /// Music: Play .MOD file as ProTracker 1 would. + BASS_MUSIC_PT1MOD = BASS_MIDI_DECAYSEEK, // 0x00004000 + + /// + /// Music: Use non-interpolated mixing. This generally reduces the sound quality, but can be good for chip-tunes. + /// + BASS_MUSIC_NONINTER = BASS_FX_FREESOURCE, // 0x00010000 + + /// + /// Music: Sinc interpolated sample mixing. + /// This increases the sound quality, but also requires quite a bit more processing. If neither this or the BASS_MUSIC_NONINTER flag is specified, linear interpolation is used. + /// + BASS_MUSIC_SINCINTER = BASS_MIDI_FONT_NOLIMITS, // 0x00800000 + + /// + /// Music: Stop all notes when seeking (using ). + /// + BASS_MUSIC_POSRESET = BASS_MIDI_NOCROP, // 0x00008000 + + /// Music: Stop all notes and reset bpm/etc when seeking. + BASS_MUSIC_POSRESETEX = BASS_MIDI_FONT_NORAMPIN, // 0x00400000 + + /// + /// Music: Stop the music when a backward jump effect is played. This stops musics that never reach the end from going into endless loops. + /// Some MOD musics are designed to jump all over the place, so this flag would cause those to be stopped prematurely. + /// If this flag is used together with the BASS_SAMPLE_LOOP flag, then the music would not be stopped but any BASS_SYNC_END sync would be triggered. + /// + BASS_MUSIC_STOPBACK = BASS_MIDI_FONT_NOFX, // 0x00080000 + + /// + /// Music: Don't load the samples. This reduces the time taken to load the music, notably with MO3 files, which is useful if you just want to get the name and length of the music without playing it. + /// + BASS_MUSIC_NOSAMPLE = BASS_MIDI_FONT_LINATTMOD, // 0x00100000 +} \ No newline at end of file diff --git a/src/Zen.System/Modules/Audio/Engines/Bass/BassInit.cs b/src/Zen.System/Modules/Audio/Engines/Bass/BassInit.cs new file mode 100644 index 00000000..dfca0806 --- /dev/null +++ b/src/Zen.System/Modules/Audio/Engines/Bass/BassInit.cs @@ -0,0 +1,52 @@ +// ReSharper disable InconsistentNaming +// ReSharper disable UnusedMember.Global +namespace Zen.System.Modules.Audio.Engines.Bass; + +[Flags] +public enum BassInit +{ + BASS_DEVICE_DEFAULT = 0, + /// Use mono, else stereo. + BASS_DEVICE_MONO = 2, + /// Limit output to 16-bit. + BASS_DEVICE_16BITS = 8, + /// Reinitialize + BASS_DEVICE_REINIT = 128, // 0x00000080 + /// Calculate device latency (BASS_INFO struct). + BASS_DEVICE_LATENCY = 256, // 0x00000100 + /// + /// Use the Windows control panel setting to detect the number of speakers. + /// Only use this option if BASS doesn't detect the correct number of supported speakers automatically and you want to force BASS to use the number of speakers as configured in the windows control panel. + /// + BASS_DEVICE_CPSPEAKERS = 1024, // 0x00000400 + /// + /// Force enabling of speaker assignment (always 8 speakers will be used regardless if the soundcard supports them). + /// Only use this option if BASS doesn't detect the correct number of supported speakers automatically and you want to force BASS to use 8 speakers. + /// + BASS_DEVICE_SPEAKERS = 2048, // 0x00000800 + /// Ignore speaker arrangement + BASS_DEVICE_NOSPEAKER = 4096, // 0x00001000 + /// + /// Linux-only: Initialize the device using the ALSA "dmix" plugin, else initialize the device for exclusive access. + /// + BASS_DEVIDE_DMIX = 8192, // 0x00002000 + /// + /// Set the device's output rate to freq, otherwise leave it as it is. + /// + BASS_DEVICE_FREQ = 16384, // 0x00004000 + /// + /// Limits the output to stereo (only really affects Linux; it's ignored on Windows and OSX). + /// + BASS_DEVICE_STEREO = 32768, // 0x00008000 + /// Use hog/exclusive mode. + BASS_DEVICE_HOG = 65536, // 0x00010000 + /// + /// Initialize the device to use AudioTrack output instead of OpenSL ES. + /// If OpenSL ES is not available (pre-2.3 Android), then this will be applied automatically. + /// + BASS_DEVICE_AUDIOTRACK = 131072, // 0x00020000 + /// use DirectSound output + BASS_DEVICE_DSOUND = 262144, // 0x00040000 + /// Disable hardware/fastpath output + BASS_DEVICE_SOFTWARE = 524288, // 0x00080000 +} \ No newline at end of file diff --git a/src/Zen.System/Modules/Audio/Engines/Bass/BassSync.cs b/src/Zen.System/Modules/Audio/Engines/Bass/BassSync.cs new file mode 100644 index 00000000..048e1046 --- /dev/null +++ b/src/Zen.System/Modules/Audio/Engines/Bass/BassSync.cs @@ -0,0 +1,43 @@ +// ReSharper disable InconsistentNaming +// ReSharper disable UnusedMember.Global +namespace Zen.System.Modules.Audio.Engines.Bass; + +public enum BassSync +{ + BASS_SYNC_POS = 0, + BASS_SYNC_MUSICINST = 1, + BASS_SYNC_END = 2, + BASS_SYNC_MUSICFX = BASS_SYNC_END | BASS_SYNC_MUSICINST, // 0x00000003 + BASS_SYNC_META = 4, + BASS_SYNC_SLIDE = BASS_SYNC_META | BASS_SYNC_MUSICINST, // 0x00000005 + BASS_SYNC_STALL = BASS_SYNC_META | BASS_SYNC_END, // 0x00000006 + BASS_SYNC_DOWNLOAD = BASS_SYNC_STALL | BASS_SYNC_MUSICINST, // 0x00000007 + BASS_SYNC_FREE = 8, + BASS_SYNC_MUSICPOS = BASS_SYNC_FREE | BASS_SYNC_END, // 0x0000000A + BASS_SYNC_SETPOS = BASS_SYNC_MUSICPOS | BASS_SYNC_MUSICINST, // 0x0000000B + BASS_SYNC_OGG_CHANGE = BASS_SYNC_FREE | BASS_SYNC_META, // 0x0000000C + BASS_SYNC_DEV_FAIL = BASS_SYNC_OGG_CHANGE | BASS_SYNC_END, // 0x0000000E + BASS_SYNC_DEV_FORMAT = BASS_SYNC_DEV_FAIL | BASS_SYNC_MUSICINST, // 0x0000000F + BASS_SYNC_THREAD = 536870912, // 0x20000000 + BASS_SYNC_MIXTIME = 1073741824, // 0x40000000 + BASS_SYNC_ONETIME = -2147483648, // 0x80000000 + BASS_SYNC_MIXER_ENVELOPE = 66048, // 0x00010200 + BASS_SYNC_MIXER_ENVELOPE_NODE = BASS_SYNC_MIXER_ENVELOPE | BASS_SYNC_MUSICINST, // 0x00010201 + BASS_SYNC_MIXER_QUEUE = BASS_SYNC_MIXER_ENVELOPE | BASS_SYNC_END, // 0x00010202 + BASS_SYNC_WMA_CHANGE = 65792, // 0x00010100 + BASS_SYNC_WMA_META = BASS_SYNC_WMA_CHANGE | BASS_SYNC_MUSICINST, // 0x00010101 + BASS_SYNC_CD_ERROR = 1000, // 0x000003E8 + BASS_SYNC_CD_SPEED = BASS_SYNC_CD_ERROR | BASS_SYNC_END, // 0x000003EA + BASS_WINAMP_SYNC_BITRATE = 100, // 0x00000064 + BASS_SYNC_MIDI_MARKER = 65536, // 0x00010000 + BASS_SYNC_MIDI_CUE = BASS_SYNC_MIDI_MARKER | BASS_SYNC_MUSICINST, // 0x00010001 + BASS_SYNC_MIDI_LYRIC = BASS_SYNC_MIDI_MARKER | BASS_SYNC_END, // 0x00010002 + BASS_SYNC_MIDI_TEXT = BASS_SYNC_MIDI_LYRIC | BASS_SYNC_MUSICINST, // 0x00010003 + BASS_SYNC_MIDI_EVENT = BASS_SYNC_MIDI_MARKER | BASS_SYNC_META, // 0x00010004 + BASS_SYNC_MIDI_TICK = BASS_SYNC_MIDI_EVENT | BASS_SYNC_MUSICINST, // 0x00010005 + BASS_SYNC_MIDI_TIMESIG = BASS_SYNC_MIDI_EVENT | BASS_SYNC_END, // 0x00010006 + BASS_SYNC_MIDI_KEYSIG = BASS_SYNC_MIDI_TIMESIG | BASS_SYNC_MUSICINST, // 0x00010007 + BASS_SYNC_HLS_SEGMENT = 66304, // 0x00010300 + BASS_SYNC_HLS_SDT = BASS_SYNC_HLS_SEGMENT | BASS_SYNC_MUSICINST, // 0x00010301 + BASS_SYNC_HLS_EMSG = BASS_SYNC_HLS_SEGMENT | BASS_SYNC_END, // 0x00010302 +} \ No newline at end of file diff --git a/src/Zen.System/Modules/Audio/Engines/Bass/ManagedBass.cs b/src/Zen.System/Modules/Audio/Engines/Bass/ManagedBass.cs new file mode 100644 index 00000000..341ed2c3 --- /dev/null +++ b/src/Zen.System/Modules/Audio/Engines/Bass/ManagedBass.cs @@ -0,0 +1,33 @@ +using System.Runtime.InteropServices; + +namespace Zen.System.Modules.Audio.Engines.Bass; + +public static class ManagedBass +{ + [DllImport("bass")] + [return: MarshalAs((UnmanagedType) 2)] + public static extern bool BASS_Init(int device, int freq, BassInit flags, IntPtr win); + + [DllImport("bass")] + public static extern int BASS_SampleCreate(int length, int freq, int chans, int max, BassFlag flags); + + [DllImport("bass")] + [return: MarshalAs((UnmanagedType) 2)] + public static extern bool BASS_SampleSetData(int handle, float[] buffer); + + [DllImport("bass", CharSet = CharSet.Unicode)] + public static extern int BASS_SampleGetChannel(int handle, BassFlag flags); + + [DllImport("bass")] + public static extern int BASS_ChannelSetSync(int handle, BassSync type, long param, SyncProc proc, IntPtr user); + + [DllImport("bass")] + [return: MarshalAs((UnmanagedType) 2)] + public static extern bool BASS_ChannelPlay(int handle, [MarshalAs((UnmanagedType) 2)] bool restart); + + [DllImport("bass")] + [return: MarshalAs((UnmanagedType) 2)] + public static extern bool BASS_Free(); + + public delegate void SyncProc(int handle, int channel, int data, IntPtr user); +} \ No newline at end of file diff --git a/src/Zen.System/Modules/Audio/Engines/BassAudioEngine.cs b/src/Zen.System/Modules/Audio/Engines/BassAudioEngine.cs index c0a1d958..c410856c 100644 --- a/src/Zen.System/Modules/Audio/Engines/BassAudioEngine.cs +++ b/src/Zen.System/Modules/Audio/Engines/BassAudioEngine.cs @@ -1,6 +1,6 @@ using System.Runtime.InteropServices; -using Un4seen.Bass; using Zen.Common.Infrastructure; +using Zen.System.Modules.Audio.Engines.Bass; namespace Zen.System.Modules.Audio.Engines; @@ -51,13 +51,13 @@ public void Send(float[] data) _first = false; } - Bass.BASS_SampleSetData(_sampleHandle, data); + ManagedBass.BASS_SampleSetData(_sampleHandle, data); - _channel = Bass.BASS_SampleGetChannel(_sampleHandle, BASSFlag.BASS_SAMCHAN_STREAM); + _channel = ManagedBass.BASS_SampleGetChannel(_sampleHandle, BassFlag.BASS_SAMCHAN_STREAM); - Bass.BASS_ChannelSetSync(_channel, BASSSync.BASS_SYNC_END | BASSSync.BASS_SYNC_ONETIME, Constants.DefaultBufferSize * 4, PlayComplete, IntPtr.Zero); + ManagedBass.BASS_ChannelSetSync(_channel, BassSync.BASS_SYNC_END | BassSync.BASS_SYNC_ONETIME, Constants.DefaultBufferSize * 4, PlayComplete, IntPtr.Zero); - Bass.BASS_ChannelPlay(_channel, false); + ManagedBass.BASS_ChannelPlay(_channel, false); } public void Reset() @@ -67,7 +67,7 @@ public void Reset() public void Dispose() { - Bass.BASS_Free(); + ManagedBass.BASS_Free(); } private static void PlayComplete(int handle, int channel, int data, IntPtr user) @@ -79,9 +79,9 @@ private void Initialise() { try { - Bass.BASS_Init(-1, Constants.SampleRate, BASSInit.BASS_DEVICE_MONO, IntPtr.Zero); + ManagedBass.BASS_Init(-1, Constants.SampleRate, BassInit.BASS_DEVICE_MONO, IntPtr.Zero); - _sampleHandle = Bass.BASS_SampleCreate(Constants.DefaultBufferSize * 4, Constants.SampleRate, 1, 1, BASSFlag.BASS_SAMPLE_FLOAT); + _sampleHandle = ManagedBass.BASS_SampleCreate(Constants.DefaultBufferSize * 4, Constants.SampleRate, 1, 1, BassFlag.BASS_SAMPLE_FLOAT); } catch (Exception exception) { diff --git a/src/Zen.System/Zen.System.csproj b/src/Zen.System/Zen.System.csproj index 5bd946bc..d880ead1 100644 --- a/src/Zen.System/Zen.System.csproj +++ b/src/Zen.System/Zen.System.csproj @@ -18,7 +18,6 @@ - From 7a87eef6f6da5bb9073c3b5138aafc77f9dc19f1 Mon Sep 17 00:00:00 2001 From: Stevo John Date: Fri, 16 Aug 2024 16:30:45 +0100 Subject: [PATCH 2/5] WIP --- .../Modules/Audio/Engines/Bass/BassFlag.cs | 122 ------------------ 1 file changed, 122 deletions(-) diff --git a/src/Zen.System/Modules/Audio/Engines/Bass/BassFlag.cs b/src/Zen.System/Modules/Audio/Engines/Bass/BassFlag.cs index 68c9bfcd..79b5dd9c 100644 --- a/src/Zen.System/Modules/Audio/Engines/Bass/BassFlag.cs +++ b/src/Zen.System/Modules/Audio/Engines/Bass/BassFlag.cs @@ -113,157 +113,35 @@ public enum BassFlag BASS_MIDI_FONT_LINDECVOL = BASS_STREAM_DECODE, // 0x00200000 BASS_MIDI_FONT_NORAMPIN = BASS_MIDI_ASYNC, // 0x00400000 BASS_MIDI_FONT_NOLIMITS = BASS_MIDI_SINCINTER, // 0x00800000 - - /// - /// BASSMIDI add-on: Treat the reverb/chorus levels in the soundfont as minimums. The higher of them and the MIDI levels (CC91/93) will be used instead of the sum of both. - /// BASS_MIDI_FONT_MINFX = BASS_SPEAKER_PAIR1, // 0x01000000 - - /// - /// BASSMIDI add-on: Don't send a WAVE header to the encoder. If this flag is used then the sample format (mono 16-bit) must be passed to the encoder some other way, eg. via the command-line. - /// BASS_MIDI_PACK_NOHEAD = BASS_SAMCHAN_NEW, // 0x00000001 - - /// - /// BASSMIDI add-on: Reduce 24-bit sample data to 16-bit before encoding. - /// BASS_MIDI_PACK_16BIT = BASS_SAMCHAN_STREAM, // 0x00000002 - - /// - /// BASSMIDI add-on: Set encoding rate to 48000 Hz (else 44100 Hz). - /// BASS_MIDI_PACK_48KHZ = BASS_SAMPLE_LOOP, // 0x00000004 - - /// BASS_FX add-on: Free the source handle as well? BASS_FX_FREESOURCE = BASS_MIDI_FONT_MEM, // 0x00010000 - - /// - /// BASS_FX add-on: If in use, then you can do other stuff while detection's in process. - /// BASS_FX_BPM_BKGRND = BASS_MIDI_PACK_NOHEAD, // 0x00000001 - - /// - /// BASS_FX add-on: If in use, then will auto multiply bpm by 2 (if BPM < MinBPM*2) - /// BASS_FX_BPM_MULT2 = BASS_MIDI_PACK_16BIT, // 0x00000002 - - /// - /// BASS_FX add-on (AddOn.Fx.BassFx.BASS_FX_TempoCreate): Uses a linear interpolation mode (simple). - /// BASS_FX_TEMPO_ALGO_LINEAR = BASS_CD_SUBCHANNEL, // 0x00000200 - - /// - /// BASS_FX add-on (AddOn.Fx.BassFx.BASS_FX_TempoCreate): Uses a cubic interpolation mode (recommended, default). - /// BASS_FX_TEMPO_ALGO_CUBIC = BASS_MIDI_NODRUMPARAM, // 0x00000400 - - /// - /// BASS_FX add-on (AddOn.Fx.BassFx.BASS_FX_TempoCreate): Uses a 8-tap band-limited Shannon interpolation (complex, but not much better than cubic). - /// BASS_FX_TEMPO_ALGO_SHANNON = BASS_MIDI_NOSYSRESET, // 0x00000800 - - /// - /// Music: Use 32-bit floating-point sample data (see Floating-Point Channels for details). WDM drivers or the BASS_STREAM_DECODE flag are required to use this flag. - /// BASS_MUSIC_FLOAT = BASS_SAMPLE_FLOAT, // 0x00000100 - - /// - /// Music: Decode/play the mod music in mono, reducing the CPU usage (if it was originally stereo). - /// This flag is automatically applied if BASS_DEVICE_MONO was specified when calling . - /// BASS_MUSIC_MONO = BASS_FX_BPM_MULT2, // 0x00000002 - - /// - /// Music: Loop the music. This flag can be toggled at any time using . - /// BASS_MUSIC_LOOP = BASS_MIDI_PACK_48KHZ, // 0x00000004 - - /// - /// Music: Use 3D functionality. This is ignored if BASS_DEVICE_3D wasn't specified when calling . - /// 3D streams must be mono (chans=1). The SPEAKER flags can not be used together with this flag. - /// BASS_MUSIC_3D = BASS_SAMPLE_3D, // 0x00000008 - - /// - /// Music: Enable the old implementation of DirectX 8 effects. See the DX8 effect implementations section for details. - /// Use to add effects to the stream. Requires DirectX 8 or above. - /// BASS_MUSIC_FX = BASS_SAMPLE_FX, // 0x00000080 - - /// - /// Music: Automatically free the music when it ends. This allows you to play a music and forget about it, as BASS will automatically free the music's resources when it has reached the end or when (or ) is called. - /// Note that some musics never actually end on their own (ie. without you stopping them). - /// BASS_MUSIC_AUTOFREE = BASS_MIDI_FONT_XGDRUMS, // 0x00040000 - - /// - /// Music: Decode the music into sample data, without outputting it. - /// Use to retrieve decoded sample data. - /// BASS_SAMPLE_SOFTWARE/3D/FX/AUTOFREE are ignored when using this flag, as are the SPEAKER flags. - /// BASS_MUSIC_DECODE = BASS_MIDI_FONT_LINDECVOL, // 0x00200000 - - /// - /// Music: Calculate the playback length of the music, and enable seeking in bytes. This slightly increases the time taken to load the music, depending on how long it is. - /// In the case of musics that loop, the length until the loop occurs is calculated. Use to retrieve the length. - /// BASS_MUSIC_PRESCAN = BASS_MIDI_FONT_MMAP, // 0x00020000 - - /// - /// Music: Use "normal" ramping (as used in FastTracker 2). - /// BASS_MUSIC_RAMP = BASS_FX_TEMPO_ALGO_LINEAR, // 0x00000200 - - /// Music: Use "sensitive" ramping. BASS_MUSIC_RAMPS = BASS_FX_TEMPO_ALGO_CUBIC, // 0x00000400 - - /// - /// Music: Apply XMPlay's surround sound to the music (ignored in mono). - /// BASS_MUSIC_SURROUND = BASS_FX_TEMPO_ALGO_SHANNON, // 0x00000800 - - /// - /// Music: Apply XMPlay's surround sound mode 2 to the music (ignored in mono). - /// BASS_MUSIC_SURROUND2 = BASS_MIDI_DECAYEND, // 0x00001000 - - /// Music: Apply FastTracker 2 panning to XM files. BASS_MUSIC_FT2PAN = BASS_MIDI_NOFX, // 0x00002000 - - /// Music: Play .MOD file as FastTracker 2 would. BASS_MUSIC_FT2MOD = BASS_MUSIC_FT2PAN, // 0x00002000 - - /// Music: Play .MOD file as ProTracker 1 would. BASS_MUSIC_PT1MOD = BASS_MIDI_DECAYSEEK, // 0x00004000 - - /// - /// Music: Use non-interpolated mixing. This generally reduces the sound quality, but can be good for chip-tunes. - /// BASS_MUSIC_NONINTER = BASS_FX_FREESOURCE, // 0x00010000 - - /// - /// Music: Sinc interpolated sample mixing. - /// This increases the sound quality, but also requires quite a bit more processing. If neither this or the BASS_MUSIC_NONINTER flag is specified, linear interpolation is used. - /// BASS_MUSIC_SINCINTER = BASS_MIDI_FONT_NOLIMITS, // 0x00800000 - - /// - /// Music: Stop all notes when seeking (using ). - /// BASS_MUSIC_POSRESET = BASS_MIDI_NOCROP, // 0x00008000 - - /// Music: Stop all notes and reset bpm/etc when seeking. BASS_MUSIC_POSRESETEX = BASS_MIDI_FONT_NORAMPIN, // 0x00400000 - - /// - /// Music: Stop the music when a backward jump effect is played. This stops musics that never reach the end from going into endless loops. - /// Some MOD musics are designed to jump all over the place, so this flag would cause those to be stopped prematurely. - /// If this flag is used together with the BASS_SAMPLE_LOOP flag, then the music would not be stopped but any BASS_SYNC_END sync would be triggered. - /// BASS_MUSIC_STOPBACK = BASS_MIDI_FONT_NOFX, // 0x00080000 - - /// - /// Music: Don't load the samples. This reduces the time taken to load the music, notably with MO3 files, which is useful if you just want to get the name and length of the music without playing it. - /// BASS_MUSIC_NOSAMPLE = BASS_MIDI_FONT_LINATTMOD, // 0x00100000 } \ No newline at end of file From 52d6aa4f211f607ff158e9d69d3fe7fff14ac389 Mon Sep 17 00:00:00 2001 From: Stevo John Date: Fri, 16 Aug 2024 16:31:35 +0100 Subject: [PATCH 3/5] WIP --- .../Modules/Audio/Engines/Bass/BassInit.cs | 29 ------------------- 1 file changed, 29 deletions(-) diff --git a/src/Zen.System/Modules/Audio/Engines/Bass/BassInit.cs b/src/Zen.System/Modules/Audio/Engines/Bass/BassInit.cs index dfca0806..144761bf 100644 --- a/src/Zen.System/Modules/Audio/Engines/Bass/BassInit.cs +++ b/src/Zen.System/Modules/Audio/Engines/Bass/BassInit.cs @@ -6,47 +6,18 @@ namespace Zen.System.Modules.Audio.Engines.Bass; public enum BassInit { BASS_DEVICE_DEFAULT = 0, - /// Use mono, else stereo. BASS_DEVICE_MONO = 2, - /// Limit output to 16-bit. BASS_DEVICE_16BITS = 8, - /// Reinitialize BASS_DEVICE_REINIT = 128, // 0x00000080 - /// Calculate device latency (BASS_INFO struct). BASS_DEVICE_LATENCY = 256, // 0x00000100 - /// - /// Use the Windows control panel setting to detect the number of speakers. - /// Only use this option if BASS doesn't detect the correct number of supported speakers automatically and you want to force BASS to use the number of speakers as configured in the windows control panel. - /// BASS_DEVICE_CPSPEAKERS = 1024, // 0x00000400 - /// - /// Force enabling of speaker assignment (always 8 speakers will be used regardless if the soundcard supports them). - /// Only use this option if BASS doesn't detect the correct number of supported speakers automatically and you want to force BASS to use 8 speakers. - /// BASS_DEVICE_SPEAKERS = 2048, // 0x00000800 - /// Ignore speaker arrangement BASS_DEVICE_NOSPEAKER = 4096, // 0x00001000 - /// - /// Linux-only: Initialize the device using the ALSA "dmix" plugin, else initialize the device for exclusive access. - /// BASS_DEVIDE_DMIX = 8192, // 0x00002000 - /// - /// Set the device's output rate to freq, otherwise leave it as it is. - /// BASS_DEVICE_FREQ = 16384, // 0x00004000 - /// - /// Limits the output to stereo (only really affects Linux; it's ignored on Windows and OSX). - /// BASS_DEVICE_STEREO = 32768, // 0x00008000 - /// Use hog/exclusive mode. BASS_DEVICE_HOG = 65536, // 0x00010000 - /// - /// Initialize the device to use AudioTrack output instead of OpenSL ES. - /// If OpenSL ES is not available (pre-2.3 Android), then this will be applied automatically. - /// BASS_DEVICE_AUDIOTRACK = 131072, // 0x00020000 - /// use DirectSound output BASS_DEVICE_DSOUND = 262144, // 0x00040000 - /// Disable hardware/fastpath output BASS_DEVICE_SOFTWARE = 524288, // 0x00080000 } \ No newline at end of file From 55b80eaec89c1a9f588e7a238ad6e9e6623de384 Mon Sep 17 00:00:00 2001 From: Stevo John Date: Fri, 16 Aug 2024 16:34:51 +0100 Subject: [PATCH 4/5] WIP --- .../{bass.dll => Libraries/libbass.dll} | Bin src/Zen.System/{ => Libraries}/libbass.dylib | Bin src/Zen.System/{ => Libraries}/libbass.so.arm64 | Bin src/Zen.System/{ => Libraries}/libbass.so.x64 | Bin src/Zen.System/{ => Libraries}/libportaudio.dll | Bin src/Zen.System/{ => Libraries}/libportaudio.dylib | Bin src/Zen.System/{ => Libraries}/libportaudio.so | Bin .../Modules/Audio/Engines/Bass/ManagedBass.cs | 14 +++++++------- src/Zen.System/Zen.System.csproj | 14 +++++++------- 9 files changed, 14 insertions(+), 14 deletions(-) rename src/Zen.System/{bass.dll => Libraries/libbass.dll} (100%) rename src/Zen.System/{ => Libraries}/libbass.dylib (100%) rename src/Zen.System/{ => Libraries}/libbass.so.arm64 (100%) rename src/Zen.System/{ => Libraries}/libbass.so.x64 (100%) rename src/Zen.System/{ => Libraries}/libportaudio.dll (100%) rename src/Zen.System/{ => Libraries}/libportaudio.dylib (100%) rename src/Zen.System/{ => Libraries}/libportaudio.so (100%) diff --git a/src/Zen.System/bass.dll b/src/Zen.System/Libraries/libbass.dll similarity index 100% rename from src/Zen.System/bass.dll rename to src/Zen.System/Libraries/libbass.dll diff --git a/src/Zen.System/libbass.dylib b/src/Zen.System/Libraries/libbass.dylib similarity index 100% rename from src/Zen.System/libbass.dylib rename to src/Zen.System/Libraries/libbass.dylib diff --git a/src/Zen.System/libbass.so.arm64 b/src/Zen.System/Libraries/libbass.so.arm64 similarity index 100% rename from src/Zen.System/libbass.so.arm64 rename to src/Zen.System/Libraries/libbass.so.arm64 diff --git a/src/Zen.System/libbass.so.x64 b/src/Zen.System/Libraries/libbass.so.x64 similarity index 100% rename from src/Zen.System/libbass.so.x64 rename to src/Zen.System/Libraries/libbass.so.x64 diff --git a/src/Zen.System/libportaudio.dll b/src/Zen.System/Libraries/libportaudio.dll similarity index 100% rename from src/Zen.System/libportaudio.dll rename to src/Zen.System/Libraries/libportaudio.dll diff --git a/src/Zen.System/libportaudio.dylib b/src/Zen.System/Libraries/libportaudio.dylib similarity index 100% rename from src/Zen.System/libportaudio.dylib rename to src/Zen.System/Libraries/libportaudio.dylib diff --git a/src/Zen.System/libportaudio.so b/src/Zen.System/Libraries/libportaudio.so similarity index 100% rename from src/Zen.System/libportaudio.so rename to src/Zen.System/Libraries/libportaudio.so diff --git a/src/Zen.System/Modules/Audio/Engines/Bass/ManagedBass.cs b/src/Zen.System/Modules/Audio/Engines/Bass/ManagedBass.cs index 341ed2c3..adc7750a 100644 --- a/src/Zen.System/Modules/Audio/Engines/Bass/ManagedBass.cs +++ b/src/Zen.System/Modules/Audio/Engines/Bass/ManagedBass.cs @@ -4,28 +4,28 @@ namespace Zen.System.Modules.Audio.Engines.Bass; public static class ManagedBass { - [DllImport("bass")] + [DllImport("Libraries/libbass")] [return: MarshalAs((UnmanagedType) 2)] public static extern bool BASS_Init(int device, int freq, BassInit flags, IntPtr win); - [DllImport("bass")] + [DllImport("Libraries/libbass")] public static extern int BASS_SampleCreate(int length, int freq, int chans, int max, BassFlag flags); - [DllImport("bass")] + [DllImport("Libraries/libbass")] [return: MarshalAs((UnmanagedType) 2)] public static extern bool BASS_SampleSetData(int handle, float[] buffer); - [DllImport("bass", CharSet = CharSet.Unicode)] + [DllImport("Libraries/libbass", CharSet = CharSet.Unicode)] public static extern int BASS_SampleGetChannel(int handle, BassFlag flags); - [DllImport("bass")] + [DllImport("Libraries/libbass")] public static extern int BASS_ChannelSetSync(int handle, BassSync type, long param, SyncProc proc, IntPtr user); - [DllImport("bass")] + [DllImport("Libraries/libbass")] [return: MarshalAs((UnmanagedType) 2)] public static extern bool BASS_ChannelPlay(int handle, [MarshalAs((UnmanagedType) 2)] bool restart); - [DllImport("bass")] + [DllImport("Libraries/libbass")] [return: MarshalAs((UnmanagedType) 2)] public static extern bool BASS_Free(); diff --git a/src/Zen.System/Zen.System.csproj b/src/Zen.System/Zen.System.csproj index d880ead1..a67b0d07 100644 --- a/src/Zen.System/Zen.System.csproj +++ b/src/Zen.System/Zen.System.csproj @@ -21,25 +21,25 @@ - + PreserveNewest - + PreserveNewest - + PreserveNewest - + PreserveNewest - + PreserveNewest - + PreserveNewest - + PreserveNewest From 9862191bb890e3c2cffd68f37585d7f58b921462 Mon Sep 17 00:00:00 2001 From: Stevo John Date: Fri, 16 Aug 2024 16:37:59 +0100 Subject: [PATCH 5/5] WIP --- src/Zen.System/Modules/Audio/Engines/PortAudioEngine.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Zen.System/Modules/Audio/Engines/PortAudioEngine.cs b/src/Zen.System/Modules/Audio/Engines/PortAudioEngine.cs index 0ce6c3f1..6142560d 100644 --- a/src/Zen.System/Modules/Audio/Engines/PortAudioEngine.cs +++ b/src/Zen.System/Modules/Audio/Engines/PortAudioEngine.cs @@ -43,12 +43,12 @@ private void Initialise() } else { - BufdioLib.InitializePortAudio(Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "libportaudio.dylib")); + BufdioLib.InitializePortAudio(Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "Libraries", "libportaudio.dylib")); } } else { - BufdioLib.InitializePortAudio(Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "libportaudio")); + BufdioLib.InitializePortAudio(Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "Libraries", "libportaudio")); } _engine = new Bufdio.Engines.PortAudioEngine(new AudioEngineOptions(1, Constants.SampleRate));