ManagedBass.Substream 0.1.1

dotnet add package ManagedBass.Substream --version 0.1.1                
NuGet\Install-Package ManagedBass.Substream -Version 0.1.1                
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.Substream" Version="0.1.1" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add ManagedBass.Substream --version 0.1.1                
#r "nuget: ManagedBass.Substream, 0.1.1"                
#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.Substream as a Cake Addin
#addin nuget:?package=ManagedBass.Substream&version=0.1.1

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

BASS_SUBSTREAM

A BASS plugin which creates a stream from a parent with offset and length positions. It was developed to support .cue files. The child stream will return the same attributes as the parent and simplifies other code as you don't need to track the start and end positions, BASS_ChannelGetLength functions as expected.

Currently only one child stream can be created per master as the position is not maintained.

A .cue sheet parser can be found here.
Example integration can be found here.

A simple example;

// ****
// Play from position 01:00 to 02:00.
// ****

if (!Bass.Init(Bass.DefaultDevice))
{
	Assert.Fail(string.Format("Failed to initialize BASS: {0}", Enum.GetName(typeof(Errors), Bass.LastError)));
}

var sourceChannel = Bass.CreateStream("Test.mp3", 0, 0, BassFlags.Decode);
if (sourceChannel == 0)
{
	Assert.Fail(string.Format("Failed to create source stream: {0}", Enum.GetName(typeof(Errors), Bass.LastError)));
}

var playbackChannel = BassSubstream.CreateStream(sourceChannel, GetPosition(sourceChannel, "01:00"), GetPosition(sourceChannel, "01:00"));
if (playbackChannel == 0)
{
	Assert.Fail(string.Format("Failed to create playback stream: {0}", Enum.GetName(typeof(Errors), Bass.LastError)));
}

if (!Bass.ChannelPlay(playbackChannel))
{
	Assert.Fail(string.Format("Failed to start playback stream: {0}", Enum.GetName(typeof(Errors), Bass.LastError)));
}


......


private static long GetPosition(int handle, string position)
{
	if (string.IsNullOrEmpty(position))
	{
		return 0;
	}
	var offset = TimeSpan.Parse(position).TotalSeconds;
	return Bass.ChannelSeconds2Bytes(handle, offset);
}
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.1.1 955 7/7/2022
0.1.0 228 7/7/2022