static int allua_audio_stream_set_pan(lua_State * L) { ALLUA_audio_stream audio_stream = allua_check_audio_stream(L, 1); float val = luaL_checknumber(L, 2); lua_pushboolean(L, al_set_audio_stream_pan(audio_stream, val)); return 1; }
void AllegroMusicSample5::SetPan( float value ) { if ( !m_pInstance ) return; al_set_audio_stream_pan( m_pInstance, value ); }
void Prog::handle_event(const ALLEGRO_EVENT & event) { if (event.type == ALLEGRO_EVENT_AUDIO_STREAM_FRAGMENT) { ALLEGRO_AUDIO_STREAM *stream; Group *group; void *buf; float gain; float pan; stream = (ALLEGRO_AUDIO_STREAM *) event.any.source; buf = al_get_audio_stream_fragment(stream); if (!buf) { /* This is a normal condition that you must deal with. */ return; } if (stream == stream1) group = &group1; else if (stream == stream2) group = &group2; else if (stream == stream3) group = &group3; else if (stream == stream4) group = &group4; else if (stream == stream5) group = &group5; else group = NULL; ALLEGRO_ASSERT(group); if (group) { group->generate((float *) buf, SAMPLES_PER_BUFFER); if (group->get_gain_if_changed(&gain)) { al_set_audio_stream_gain(stream, gain); } if (group->get_pan_if_changed(&pan)) { al_set_audio_stream_pan(stream, pan); } } if (!al_set_audio_stream_fragment(stream, buf)) { log_printf("Error setting stream fragment.\n"); } } }
void set_sound_pan(sound_t* sound, float pan) { al_set_audio_stream_pan(sound->stream, pan); }