tags:

views:

58

answers:

1

How can I change volume in bass.dll? I am programming in C#. I tried:

    public void ChangeVolume(int volume)
    {
        Bass.BASS_ChannelSetAttributes(stream, 44100, volume, 0);
    }

volume is here:

    private void trackBar1_Scroll(object sender, EventArgs e)
    {
        label4.Text = "Volume: " + trackBar1.Value.ToString();
        player.ChangeVolume(trackBar1.Value);
    }

When I try to debug, it compiles and runs. But when I try to change volume, it stops and throws "Unable to find an entry point named "Bass_ChannelSetAttributes in DLL "bass.dll". What am I doing wrong?

+2  A: 

Using Dumpbin.exe /exports bass.dll reveals this line in the output:

    26   19 0001BF28 BASS_ChannelSetAttribute

Note how it doesn't have an "s" at the end. Wrong [DllImport] declaration in your code, probably.

Hans Passant