Added support for Ogg clips, which are decompressed when bound.

git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4110 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
Andrzej Kapolka
2006-05-10 23:44:11 +00:00
parent b804f12d5d
commit 10c6d854f5
5 changed files with 151 additions and 6 deletions
@@ -194,8 +194,15 @@ public class ClipBuffer
*/
protected boolean bind (Clip clip)
{
AL10.alBufferData(
_bufferId.get(0), clip.format, clip.data, clip.frequency);
try {
AL10.alBufferData(
_bufferId.get(0), clip.format, clip.getData(), clip.frequency);
} catch (IOException e) {
Log.warning("Error decoding clip [key=" + getKey() +
", error=" + e + "].");
failed();
return false;
}
int errno = AL10.alGetError();
if (errno != AL10.AL_NO_ERROR) {
Log.warning("Failed to bind clip [key=" + getKey() +