Skip to content

Commit

Permalink
Merge pull request #38 from stevehjohn/bass
Browse files Browse the repository at this point in the history
Removed NuGet
  • Loading branch information
stevehjohn authored Aug 16, 2024
2 parents 6564386 + 9862191 commit e3b15f7
Show file tree
Hide file tree
Showing 14 changed files with 263 additions and 18 deletions.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
147 changes: 147 additions & 0 deletions src/Zen.System/Modules/Audio/Engines/Bass/BassFlag.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,147 @@
// 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
BASS_MIDI_FONT_MINFX = BASS_SPEAKER_PAIR1, // 0x01000000
BASS_MIDI_PACK_NOHEAD = BASS_SAMCHAN_NEW, // 0x00000001
BASS_MIDI_PACK_16BIT = BASS_SAMCHAN_STREAM, // 0x00000002
BASS_MIDI_PACK_48KHZ = BASS_SAMPLE_LOOP, // 0x00000004
BASS_FX_FREESOURCE = BASS_MIDI_FONT_MEM, // 0x00010000
BASS_FX_BPM_BKGRND = BASS_MIDI_PACK_NOHEAD, // 0x00000001
BASS_FX_BPM_MULT2 = BASS_MIDI_PACK_16BIT, // 0x00000002
BASS_FX_TEMPO_ALGO_LINEAR = BASS_CD_SUBCHANNEL, // 0x00000200
BASS_FX_TEMPO_ALGO_CUBIC = BASS_MIDI_NODRUMPARAM, // 0x00000400
BASS_FX_TEMPO_ALGO_SHANNON = BASS_MIDI_NOSYSRESET, // 0x00000800
BASS_MUSIC_FLOAT = BASS_SAMPLE_FLOAT, // 0x00000100
BASS_MUSIC_MONO = BASS_FX_BPM_MULT2, // 0x00000002
BASS_MUSIC_LOOP = BASS_MIDI_PACK_48KHZ, // 0x00000004
BASS_MUSIC_3D = BASS_SAMPLE_3D, // 0x00000008
BASS_MUSIC_FX = BASS_SAMPLE_FX, // 0x00000080
BASS_MUSIC_AUTOFREE = BASS_MIDI_FONT_XGDRUMS, // 0x00040000
BASS_MUSIC_DECODE = BASS_MIDI_FONT_LINDECVOL, // 0x00200000
BASS_MUSIC_PRESCAN = BASS_MIDI_FONT_MMAP, // 0x00020000
BASS_MUSIC_RAMP = BASS_FX_TEMPO_ALGO_LINEAR, // 0x00000200
BASS_MUSIC_RAMPS = BASS_FX_TEMPO_ALGO_CUBIC, // 0x00000400
BASS_MUSIC_SURROUND = BASS_FX_TEMPO_ALGO_SHANNON, // 0x00000800
BASS_MUSIC_SURROUND2 = BASS_MIDI_DECAYEND, // 0x00001000
BASS_MUSIC_FT2PAN = BASS_MIDI_NOFX, // 0x00002000
BASS_MUSIC_FT2MOD = BASS_MUSIC_FT2PAN, // 0x00002000
BASS_MUSIC_PT1MOD = BASS_MIDI_DECAYSEEK, // 0x00004000
BASS_MUSIC_NONINTER = BASS_FX_FREESOURCE, // 0x00010000
BASS_MUSIC_SINCINTER = BASS_MIDI_FONT_NOLIMITS, // 0x00800000
BASS_MUSIC_POSRESET = BASS_MIDI_NOCROP, // 0x00008000
BASS_MUSIC_POSRESETEX = BASS_MIDI_FONT_NORAMPIN, // 0x00400000
BASS_MUSIC_STOPBACK = BASS_MIDI_FONT_NOFX, // 0x00080000
BASS_MUSIC_NOSAMPLE = BASS_MIDI_FONT_LINATTMOD, // 0x00100000
}
23 changes: 23 additions & 0 deletions src/Zen.System/Modules/Audio/Engines/Bass/BassInit.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
// ReSharper disable InconsistentNaming
// ReSharper disable UnusedMember.Global
namespace Zen.System.Modules.Audio.Engines.Bass;

[Flags]
public enum BassInit
{
BASS_DEVICE_DEFAULT = 0,
BASS_DEVICE_MONO = 2,
BASS_DEVICE_16BITS = 8,
BASS_DEVICE_REINIT = 128, // 0x00000080
BASS_DEVICE_LATENCY = 256, // 0x00000100
BASS_DEVICE_CPSPEAKERS = 1024, // 0x00000400
BASS_DEVICE_SPEAKERS = 2048, // 0x00000800
BASS_DEVICE_NOSPEAKER = 4096, // 0x00001000
BASS_DEVIDE_DMIX = 8192, // 0x00002000
BASS_DEVICE_FREQ = 16384, // 0x00004000
BASS_DEVICE_STEREO = 32768, // 0x00008000
BASS_DEVICE_HOG = 65536, // 0x00010000
BASS_DEVICE_AUDIOTRACK = 131072, // 0x00020000
BASS_DEVICE_DSOUND = 262144, // 0x00040000
BASS_DEVICE_SOFTWARE = 524288, // 0x00080000
}
43 changes: 43 additions & 0 deletions src/Zen.System/Modules/Audio/Engines/Bass/BassSync.cs
Original file line number Diff line number Diff line change
@@ -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
}
33 changes: 33 additions & 0 deletions src/Zen.System/Modules/Audio/Engines/Bass/ManagedBass.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
using System.Runtime.InteropServices;

namespace Zen.System.Modules.Audio.Engines.Bass;

public static class ManagedBass
{
[DllImport("Libraries/libbass")]
[return: MarshalAs((UnmanagedType) 2)]
public static extern bool BASS_Init(int device, int freq, BassInit flags, IntPtr win);

[DllImport("Libraries/libbass")]
public static extern int BASS_SampleCreate(int length, int freq, int chans, int max, BassFlag flags);

[DllImport("Libraries/libbass")]
[return: MarshalAs((UnmanagedType) 2)]
public static extern bool BASS_SampleSetData(int handle, float[] buffer);

[DllImport("Libraries/libbass", CharSet = CharSet.Unicode)]
public static extern int BASS_SampleGetChannel(int handle, BassFlag flags);

[DllImport("Libraries/libbass")]
public static extern int BASS_ChannelSetSync(int handle, BassSync type, long param, SyncProc proc, IntPtr user);

[DllImport("Libraries/libbass")]
[return: MarshalAs((UnmanagedType) 2)]
public static extern bool BASS_ChannelPlay(int handle, [MarshalAs((UnmanagedType) 2)] bool restart);

[DllImport("Libraries/libbass")]
[return: MarshalAs((UnmanagedType) 2)]
public static extern bool BASS_Free();

public delegate void SyncProc(int handle, int channel, int data, IntPtr user);
}
16 changes: 8 additions & 8 deletions src/Zen.System/Modules/Audio/Engines/BassAudioEngine.cs
Original file line number Diff line number Diff line change
@@ -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;

Expand Down Expand Up @@ -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()
Expand All @@ -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)
Expand All @@ -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)
{
Expand Down
4 changes: 2 additions & 2 deletions src/Zen.System/Modules/Audio/Engines/PortAudioEngine.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand Down
15 changes: 7 additions & 8 deletions src/Zen.System/Zen.System.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -18,29 +18,28 @@

<ItemGroup>
<PackageReference Include="Bufdio" Version="0.1.0" />
<PackageReference Include="radio42.Bass.Net.core" Version="2.4.17.5" />
</ItemGroup>

<ItemGroup>
<None Update="libbass.dylib">
<None Update="Libraries\libbass.dylib">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Update="libbass.so.arm64">
<None Update="Libraries\libbass.so.arm64">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Update="bass.dll">
<None Update="Libraries\libbass.so.x64">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Update="libbass.so.x64">
<None Update="Libraries\libportaudio.dll">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Update="libportaudio.dll">
<None Update="Libraries\libportaudio.dylib">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Update="libportaudio.dylib">
<None Update="Libraries\libportaudio.so">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Update="libportaudio.so">
<None Update="Libraries\libbass.dll">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
</ItemGroup>
Expand Down

0 comments on commit e3b15f7

Please sign in to comment.