alternative reading soundfile to use with rtAudio

hi,
i am looking for an alternative way to playback samples quite precisely and sample-correct in very short loops (10-40ms), but fmod seems to run out of phase and produces slight clicks and hickups as the loop runs, which are not coming from cutting the samples at high amplitudes; it sounds like wrong timing. the loops are tightly bound to frames of a movie, which is put RAM before, so i can not really rely on a threaded audio-loop (or maybe after all). with rtAudio it works very good at these given short intervals.
i thought of using rtaudio and specify offset pointers to the sounddata, which is read from a file into an array or vector…
am i thinking to weird or might this be a solution to more precission?
and most of all, how do i actually read sounddata from a file (e.g. aif or wav) into an array, which then can be accessed by the rtaudio routines? :slight_smile:
afaik fmod reads the soundfile into RAM, right?

You can use this library to load sound files without FMOD:
http://www.mega-nerd.com/libsndfile/

Also OpenAL has a .wav file loader if you wanted to mess around with that.

Yes FMOD loads sound files into RAM, unless you stream them.

I think you should be able to get it to work with FMOD, but there may be some hidden latencies. Normally FMOD parses .mp3 files and ignores the headers to be able to loop seamlessly. Perhaps update the OF FMOD library to the latest version…they are constantly fixing bugs.