I would like to join this community. I want to use FMOD in VB.NET, but I have serious starting problems. Can anybody help me? What do you have to do with the .bas file before it works? I tried to upgrade the code with the tool that VS2003 provides, but I get lot’s of errors then. Does anybody have an example how to use FMOD in VB.NET?
Thank you very much
- eagle asked 12 years ago
Someone posted a nice fmod wrapper for .NET here:
I’ve been using it with C# for a few weeks, and have only had to change a few things. I just tried it with VB.NET, and with a little effort (I’m not a VB guy), I was able to play a stream. You have to D/L, and open the fmodmanaged.dll, and create a reference to it in your VB project. And of course, have the fmod.dll in the same directory as your executable (usually project_name\bin\debug). I also had to go into the fmodmanaged source, and remove the uint inheritance from FMOD_MODES to get VB to see them as modes, and not ints (Look for this: public enum FSOUND_MODES :uint and do this: public enum FSOUND_MODES //:uint)
Here’s all the vb code it took:
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load FmodManaged.FSOUND.Function.Initialization.FSOUND_Init(44100, 16, 0) End Sub Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Dim songStream As New IntPtr(0) Dim path As String = "C:\Documents and Settings\User\My Documents\My Music\Charles Mingus\Mingus At The Bohemia\Charles Mingus_Mingus At The Bohemia_01_Jump Monk.mp3" songStream = FmodManaged.FSOUND.Function.Stream.FSOUND_Stream_Open(path, FmodManaged.FSOUND.Enums.FSOUND_MODES.FSOUND_STEREO, 0, 0) FmodManaged.FSOUND.Function.Stream.FSOUND_Stream_Play(0, songStream) End Sub
You’ll notice that I hardcoded the mp3 path. You can just as easily get it some other way ( an OpenFile dialog, or drag / drop etc…).
- LanceDrolet answered 12 years ago
Please login first to submit.