I have a problem with CreateSound and the OPENMEMORY flag in VB6.
Have a big file with lots of individual OGG samples that I want to create a sample from.
It fails with "(25) Unsupported file or audio format".
I have checked the contents of the byte array with a memory dump and it’s ok.
If I save the byte array to file and opens it with the createsound function it works……
Extract of code:
Dim arrData() as byte
‘ some code to get the offset and length of a ogg sample within my ogg collection file
ReDim arrData(0 To lLength – 1)
‘ Getting the ogg data
Get #lHandle, lOffset + 1, arrData
CreateSample VarPtr(arrData(0), lLength
Public Function CreateSample(lPointer As Long, lLength As Long) As Long
Dim result As FMOD_RESULT
Dim exinfo As FMOD_CREATESOUNDEXINFO
' Create a sound to record to exinfo.cbsize = LenB(exinfo) exinfo.Length = lLength exinfo.suggestedsoundtype = FMOD_SOUND_TYPE_OGGVORBIS result = FMOD_System_CreateSoundEx(system, lPointer, (FMOD_OPENMEMORY Or FMOD_CREATESAMPLE), exinfo, Sound) ERRCHECK (result) CreateSample = result
- ddebono asked 10 years ago
- You must login to post comments