
Yesterday, I set out to accomplish the challenge of loading and playing a sound from a file. So far, my attempts have resulted only in silence... rather disheartening after all the effort it took to get everything to build and run cleanly. I currently take the following steps: - Load samples from file into an IOCArray using hsndfile - Create an OpenAL buffer which points to the IOCArray - Play sound using OpenAL code is at: http://hpaste.org/fastcgi/hpaste.fcgi/view?id=13836 I'm wondering if anyone who is familiar with these libraries can tell me if I'm using them sanely or not. Alternatively, if anyone has a favorite sound library and can help me get started with that, I'd be very grateful. -Matt

hi matthew, On 09.12.09 14:37, Matthew wrote:
Yesterday, I set out to accomplish the challenge of loading and playing a sound from a file. So far, my attempts have resulted only in silence... rather disheartening after all the effort it took to get everything to build and run cleanly.
I currently take the following steps: - Load samples from file into an IOCArray using hsndfile - Create an OpenAL buffer which points to the IOCArray - Play sound using OpenAL code is at: http://hpaste.org/fastcgi/hpaste.fcgi/view?id=13836
could you isolate the problem by checking if the array returned by hsndfile actually contains non-zero sample frames? e.g. by computing the maximum amplitude: (Data.List.foldl' (max) 0 . fmap abs) `fmap` Data.Array.MArray.getElems buffer you could also try to test OpenAL with a synthesized sound, e.g. sin(2*pi*f/fs*k); i'm not familiar with OpenAL, though. <sk>
participants (2)
-
Matthew
-
stefan kersten