Bass.CreateStream returns <0

pinarg

New member
Joined
May 19, 2025
Messages
3
Programming Experience
3-5
Hi;

In my Bass application I am trying to CreateStream from mp3 file or wav file however stream returns <0

Test Code:
using System;
using ManagedBass;

class Program
{
    static void Main()
    {
        Console.WriteLine("ManagedBass testing begins!");

        // Show DLL version
        Console.WriteLine($"Bass.Version: {Bass.Version}");

        // Start BASS 
        bool inited = Bass.Init();
        Console.WriteLine($"Bass.Init: {inited}, LastError: {Bass.LastError} ");

        // Clarify file path 
        string dosya = "C:\\music\\test1.wav"; // MP3 de deneyebilirsin 

        // Dosyadan stream açmayı dene 
        int stream = Bass.CreateStream(dosya, 0, 0, BassFlags.Default);
        Console.WriteLine($"Bass.CreateStream('{dosya}') → {stream}, LastError: {Bass.LastError} ");

        
        if (stream > 0)
        {
            Bass.StreamFree(stream);
            Console.WriteLine("Stream successfully opened ");
        }
        else
        {
            Console.WriteLine("Stream failed!");
        }

        // Free BASS
        Bass.Free();
    }
}

Code returns from output : Bass.CreateStream('C:\music\test1.wav') ␦ -2147483647, LastError: OK
Why -2147483647
 
Unfortunately, that decimal number just maps to 0x80000001 which is a generic error code that doesn't provide much information or context.

You'll probably get more traction by opening an issue in GitHub than asking here.

Alternatively, you could try stepping into the code with a debugger to try to narrow down exactly where it is failing since the library is open source.
 
Back
Top Bottom