I have VB.NET project that I developed over 10 years ago to record audio. The original project started out using DirectSound in VB5, then I migrated it over to VB.NET and changed to XNA. Part of the program reads data from an Access database that it uses to add metadata to the recordings (mp3s), and also uses the Access data to select particular folder location to store the mp3s…so the interface to the Access database is integral. I use VB.NET because write a lot of VBA in Excel, Word, Access, and Outlook. This all worked for many years until the Target machine changed to 64-bit Office. Now the XNA libraries are no longer compatible with 64-bit Access. I first tried using the libraries in winmm. I thought that everything was fine until I ran my test program as a 64-bit object and none of the pointers returned from the devices were correct and it blew up.
After doing some research on how Audacity handles everything, I got steered towards XtAudio. I converted the Device List (PrintSimple) and Detailed List (PrintDetailed) examples into VB, and they worked perfectly.
Then I tried the Playback (RenderSimple) example. I can’t get the syntax of callback function to work correctly. I’ve worked with Delegate Functions before, so I tried modifying the code to use that syntax, but nothing seems to fit. When I finally got it to compile, it crashed on the first line of the OnBuffer function:
Private Delegate Function delOnBuffer(ByVal stream As XtStream, ByVal buffer As XtBuffer, ByVal user As Object) As Integer
Private Shared Function OnBuffer(ByVal stream As XtStream, ByVal buffer As XtBuffer, ByVal user As Object) As Integer
Dim safe As XtSafeBuffer = XtSafeBuffer.Get(stream)
because stream is empty. Is there something that I am missing where stream gets initialized in the calling proceedure? Before:
Dim d As delOnBuffer = AddressOf fncOnBuffer
Dim myBuffer As XtBuffer
streamParams = New XtStreamParams(True, d.Invoke(Nothing, myBuffer, Nothing), Nothing, Nothing)
Any assistance/insight would be greatly appreciated. Thank you for your time in advance. Sincerely, Paul Goldstein