ManagedBass.Gapless 0.2.0

dotnet add package ManagedBass.Gapless --version 0.2.0                
NuGet\Install-Package ManagedBass.Gapless -Version 0.2.0                
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="ManagedBass.Gapless" Version="0.2.0" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add ManagedBass.Gapless --version 0.2.0                
#r "nuget: ManagedBass.Gapless, 0.2.0"                
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install ManagedBass.Gapless as a Cake Addin
#addin nuget:?package=ManagedBass.Gapless&version=0.2.0

// Install ManagedBass.Gapless as a Cake Tool
#tool nuget:?package=ManagedBass.Gapless&version=0.2.0                

BASS_GAPLESS

A gapless playback plugin for BASS with .NET bindings.

bass.dll is required for native projects. ManagedBass is required for .NET projects.

A simple example;

var sourceChannel1 = Bass.CreateStream(Path.Combine(Location, "Media", "01 Botanical Dimensions.m4a"), Flags: BassFlags.Decode);
var sourceChannel2 = Bass.CreateStream(Path.Combine(Location, "Media", "02 Outer Shpongolia.m4a"), Flags: BassFlags.Decode);

BassGapless.ChannelEnqueue(sourceChannel1);
BassGapless.ChannelEnqueue(sourceChannel2);

var channelInfo = Bass.ChannelGetInfo(sourceChannel1);
var playbackChannel = BassGapless.StreamCreate(channelInfo.Frequency, channelInfo.Channels, flags);

Bass.ChannelPlay(playbackChannel);

while (Bass.ChannelIsActive(playbackChannel) == PlaybackState.Playing)
{
    Thread.Sleep(1000);
}

Bass.StreamFree(sourceChannel1);
Bass.StreamFree(sourceChannel2);
Bass.StreamFree(playbackChannel);

Streams added to the queue must have the same rate/channels as the gapless stream.

Addon libs for ASIO/CD are included, place them in your addon folder if required. All libs can also be manually loaded;

BassGapless.Load();
BassGapless.Asio.Load();
BassGapless.Cd.Load();

ASIO example;

var sourceChannel1 = Bass.CreateStream(Path.Combine(Location, "Media", "01 Botanical Dimensions.m4a"), Flags: BassFlags.Decode);
var sourceChannel2 = Bass.CreateStream(Path.Combine(Location, "Media", "02 Outer Shpongolia.m4a"), Flags: BassFlags.Decode);

BassGapless.ChannelEnqueue(sourceChannel1);
BassGapless.ChannelEnqueue(sourceChannel2);

var channelInfo = Bass.ChannelGetInfo(sourceChannel1);

 BassGapless.Asio.ChannelEnable(false, 0);
 BassAsio.ChannelJoin(false, 1, 0);
 BassAsio.ChannelSetFormat(false, 0, AsioSampleFormat.Bit16)
 BassAsio.ChannelSetRate(false, 0, channelInfo.Frequency)

 BassAsio.Start()

while (Bass.ChannelIsActive(sourceChannel1) == PlaybackState.Playing || Bass.ChannelIsActive(sourceChannel2) == PlaybackState.Playing)
{
    Thread.Sleep(1000);
}

BassAsio.Stop();
Bass.StreamFree(sourceChannel1);
Bass.StreamFree(sourceChannel2);

CD example;

BassGapless.SetConfig(BassGaplessAttriubute.RecycleStream, true);
BassGapless.Cd.Enable(0, BassFlags.Decode);

var sourceChannel = BassCd.CreateStream(0, 0, BassFlags.Decode);

var channelInfo = Bass.ChannelGetInfo(sourceChannel1);
var playbackChannel = BassGapless.StreamCreate(channelInfo.Frequency, channelInfo.Channels, flags);

Bass.ChannelPlay(playbackChannel);

while (Bass.ChannelIsActive(playbackChannel) == PlaybackState.Playing)
{
    Thread.Sleep(1000);
}

BassGapless.Cd.Disable();
Bass.StreamFree(sourceChannel);
Bass.StreamFree(playbackChannel);
Product Compatible and additional computed target framework versions.
.NET Framework net40 is compatible.  net403 was computed.  net45 was computed.  net451 was computed.  net452 was computed.  net46 was computed.  net461 is compatible.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • .NETFramework 4.0

    • No dependencies.
  • .NETFramework 4.6.1

    • No dependencies.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
0.2.0 1,168 6/5/2022
0.1.0 915 4/22/2019