Is there any example of accessing samples from the buffer that fmod records in?
ive been looking at this example: examples-record
but this just routs the recorded signal straight into the output. i’m interested in getting the samples as small buffers for further computation, so far ive been using this:
recSound.@lock(byteOffset, lengthInBytes, out dataPtr1, out dataPtr2, out length1, out length2);
// Copy from the first block of data
if (dataPtr1 != IntPtr.Zero && length1 > 0)
{
Marshal.Copy(dataPtr1, audioData, 0, (int)length1);
}
// If there's a second block of data due to wrap-around, copy it immediately after the first block
if (dataPtr2 != IntPtr.Zero && length2 > 0)
{
Marshal.Copy(dataPtr2, audioData, (int)length1, (int)length2);
}
// Unlock the sound object
recSound.unlock(dataPtr1, dataPtr2, length1, length2);
this is inside my update() but the audio buffer i’m getting is just filled with zeros
(ive confirmed my mic works with fmod and unity with the official record example i linked to earlier)
i can’t find anything online except this one forum post:
Accessing real-time audio samples of incoming mic capture via DSPCallback
do i need to use the DSPCallback for this?
Thanks for reading