open_common();
}
+void Sound::open_common()
+{
+ delete data;
+ data = 0;
+
+ vorbis_info *info = ov_info(&ovfile, -1);
+ freq = info->rate;
+ switch(info->channels)
+ {
+ case 1: format = MONO16; break;
+ case 2: format = STEREO16; break;
+ default: throw runtime_error("Unsupported number of channels");
+ }
+}
+
void Sound::load_data()
{
if(data)
return data;
}
-void Sound::open_common()
-{
- delete data;
- data = 0;
-
- vorbis_info *info = ov_info(&ovfile, -1);
- freq = info->rate;
- switch(info->channels)
- {
- case 1: format = MONO16; break;
- case 2: format = STEREO16; break;
- default: throw runtime_error("Unsupported number of channels");
- }
-}
-
} // namespace AL
} // namespace Msp