I have trouble understanding how the Sound->lock() function works. At least, I thought I understood it, but reading this forum post confused me again: [url:1jr9kcu3]http://www.fmod.org/forum/viewtopic.php?t=13230[/url:1jr9kcu3] 😀
The example does not work for me — after the lock(), my buffer is always empty.
In particular, in the linked post I don’t know why 0 is passed as the second parameter of lock()! As far as I understand this function, the second parameter says how many bytes to lock in the buffer. So I really don’t see how passing 0 would help you get the waveform for the whole song.
Can anyone please explain how lock() could be used to get the whole waveform? Thanks!
- acgrama asked 6 years ago
the code you saw in that thread is wrong.
There should be a Sound::getLength call there with FMOD_TIMEUNIT_PCMBYTES as the timeunit, to get how long the sound is in bytes.
(after the lengthbytes declaration, and before the call to lock)
Please login first to submit.