I'm writing a music synthesizer using ocamlsdl, and I'm having trouble
writing raw audio to the audio device.
I've set up the audio device using:
Then I'm generating a chunk of audio by writing bytes directly to a string,
to convert the string buffer into an Sdlmixer chunk. Unfortunately, that
call results in a segfault.
It appears that the ocamlsdl binding maps load_string to the
Mix_QuickLoad_WAV SDL function, but my string does not have a WAV header --
it is just the raw bytes to be played. I believe that what I really want is
Mix_QuickLoad_RAW, but I don't see a binding for than in ocamlsdl.
Should the load_string OCaml function actually be calling _RAW instead of
_WAV? Is there some other, preferred way to load raw audio bytes into the
sound device? Any help would be appreciated.