On Sep 18, 2006, at 2:28 PM, Aleksi Strandberg wrote:

Hi List,

The callback i'm using with FMOD requires me to feed PCM data.
Can memoryblock be used this way?
I was unable to get this to work, the callback is called but the data feeding doesn't work, i only get some clicking as audio.
The properties sound and datalen are returned properly.


Here is Syntax:
 FMOD_RESULT F_CALLBACK  FMOD_SOUND_PCMREADCALLBACK(
  FMOD_SOUND *  sound,
  void *  data,
  unsigned int  datalen
);

The void * is a pointer to fill, not a pointer to replace.
Try this instead:

Function pcmreadcallback(byref sound as Integer, d as Ptr, datalen as Integer) as Integer dim data as MemoryBlock = d // Create a memory block with "d" as its pointer
  if data<>nil then
if receiveddata<>nil and receiveddata.size>=receivedposition +datalen then data.StringValue(0,datalen)=receiveddata.StringValue (receivedposition,datalen)
    end
  end
  receivedposition=receivedposition+datalen
  return FMOD_OK
End Function

HTH,
Jon

--
Jonathan Johnson
[EMAIL PROTECTED]
REAL Software, Inc.


_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>

Reply via email to