Voxengo Premium Membership - All Voxengo Plugins For a Fixed One-Time Fee
Forums     Plugins     r8brain PRO Using r8brain (r8b.dll) in VB6


Hello.

I am trying to use the r8brain DLL (r8b.dll) in a Visual Basic 6 application to do resampling conversions.  I have tried calling the function within this DLL like I call other Windows API functions, but all I keep getting an a GPF in VB.

Here is my VB code reference:

Private Declare Sub r8b_execute Lib "r8b.dll" (ByVal InFilename As String, ByVal OutFileName As String, ByVal OutRate As Double, ByVal OutBitDepth As Long, ByVal OutQuality As Long, ByVal Preallocate As Long, CancelFlag As Long, Callback As Variant, Pointer As Double, err As Variant)

I have the r8b.dll in the source path as well as the C:\windows\system32 folder.

ANY ideas or assistance is greatly appreciated!

Mike


Please do not use String and Variant types - they are VB types and cannot be read by the DLL.

Hmmm...well I do not understand about VB type String.  I do not think there isn't another type for character in VB 6.

I made some changes but it still causes a GPF in VB6.  Here is my call that still does not work....

Private Declare Function r8b_execute Lib "r8b.dll" (ByVal InFilename As String, ByVal OutFileName As String, ByVal OutRate As Long, ByVal OutBitDepth As Long, ByVal OutQuality As Long, ByVal Preallocate As Long, ByRef CancelFlag As Long, ByRef Callback As TR8BCallback, ByRef Pointer As Long, ByRef err As TR8Error)

Public Type TR8BCallback

Position As Long

Max As Long

xPointer As Long

End Type

Public Type TR8Error

WasError As Boolean

msg As String

End Type

My function call then is:

Dim xCallback As TR8BCallback

Dim xCancelFlag As Long

Dim xError As TR8Error

Dim xPointer As Long

r8b_execute "CT1.wav", "ct1out.wav", 0.2, 16, 1, 0, xCancelFlag, xCallback, xPointer, xError

Any ideas?  I really would like to get this working if possible.  Thanks.


Please ask this question at forum where people know more about Visual Basic.  I'm not an expert at it.  However, prototypes I provide can be converted to C/C++ easily.  So, this is only a question of type conventions.

Okay, will do.

One more question, please.

In the DLL documentation it says - OutRate - sample rate of output file.  Please, don't use extreme values for output sample rate.  Normal "designed" input to output sample rate ratio lies
between 0.2 to 5.

So how would I determine the value to use for a sample rate of 44100 or 48000?

Thanks, Mike


You should use 44100 and 48000, respectively.  It is a plain sample rate value.  Mentioned *ratio* range of 0.2 to 5 means that you should not use 500000 sample rate if your intput is only 44100 Hz.
This topic was last updated 180 days ago, and thus it was archived.  Replying is disabled for this topic.