AudioStream::AudioStream(const char *path, ALLEGRO_PLAYMODE playmode) { // load stream from file m_stream = al_load_audio_stream(path, 4, 2048); assert(m_stream); // create voice for the stream m_voice = al_create_voice(44100, al_get_audio_stream_depth(m_stream), ALLEGRO_CHANNEL_CONF_2); al_attach_audio_stream_to_voice(m_stream, m_voice); this->playmode(playmode); //al_detach_voice(m_voice); //assert(m_stream != 0); }
static int allua_audio_stream_get_depth(lua_State * L) { ALLUA_audio_stream audio_stream = allua_check_audio_stream(L, 1); lua_pushnumber(L, al_get_audio_stream_depth(audio_stream)); return 1; }