0
0

Is there no way to get the sample data from it’s C point in FMOD? I just want to save record wav data to a file. I can build the header, i just need the sampled data. I have the pointer and i know the length of the data, and there are two functions that are supposed to do it, but they don’t work correctly.

Here is the first method:

Dim wav_data as String, ptr as long
Public Declare Function ConvCStringToVBString Lib “kernel32” Alias “lstrcpyA” (ByVal lpsz As String, ByVal pt As Long) As Long
‘ Notice the As Long return value replacing the As String given by the API Viewer.

wav_data = String(100, 0)
ConvCStringToVBString wav_data, ptr
======== end =========
Ok, the above works fine, except it stops converting and importing to wav_data at the first chr(0) it encounters.

Method 2:

Public Declare Sub CopyMem Lib “kernel32” Alias “RtlMoveMemory” (Destination As Any, Source As Any, ByVal length As Long)

CopyMem wav_data, ptr1, 100
======== end =========
The above crashes my VB environment

  • You must to post comments
Showing 1 result
Your Answer

Please first to submit.