I’m having problems with the set driver/getnumdrivers functions. Firstly getnumdrivers is returning 0, and likewise so is getdrivername(0), getdrivername(1) etc..
Strangely enough i also notcied that when I call setdriver with 1 as the parameter for example it always returns false.
I tested fmod3.70 with your media player and found that it displays both soundcards in my machine as well as the primary sound driver. So the problem obviously isn’t with fmod on my machine.
All im trying to accomplish is a simple for..next loop that loops through each driver name and adds it to a combo box to allow the user to select which output device on their system they wish the track to played through
Do you know of any possible causes for this? I’m using VB.NET with a converted version of the fmod.bas file (everything else works fine :D)
Any help would be much appreciated!
- Matt asked 15 years ago
Thanks for that, putting Set_Output first before anything has fixed it fine. The only other thing now is that i’ve just realised that getdrivername returns a long which the documentation states is a pointer to a string containing the name of the device.
How do i get to this string into VB.NET? I had this problem before when i was using VB6. I ended up referencing the direct X library, initialising that to get the names into a combo, and then killing it and carrying on with fmod. But surely there must be a way to use fmod entirely
I know this is really now a question for the vb forum but i thought as it is related to my post, it might make more sense to keep the question here!
Thanks for that Sly! The stringbuilder didn’t do it, but it got me on the right track…
I ended up using the PtrToStringAnsi Function
which is part of the system.runtime.interopservices
Here’s what i did to get it working (in case anybody gets stuck on this in the future…)
Dim ptr As IntPtr = IntPtr.Zero
numdevs = fmodtest.FSOUND_GetNumDrivers
For i = 0 To numdevs – 1
ptr = New System.IntPtr(fmodtest.FSOUND_GetDriverName(i)) cboZones.Items.Add(Marshal.PtrToStringAnsi(ptr))
Cheers for all your help!
Please login first to submit.