Commit 9763fa62 authored by David Reid's avatar David Reid

Engine: Add support for fading.

This adds support for having a sound fade in when it is started and
fade out when it is stopped.

This commit does not yet include support for fading out when the sound
approaches the end - it only fades out when explicitly stopped with
ma_sound_stop().

The fade time is set in milliseconds.

This commit includes a new effect called ma_fader, but it currently
only supports f32 formats. Support for other formats will be added in
the future.
parent 764ebc5e
......@@ -39,7 +39,10 @@ int main(int argc, char** argv)
ma_engine_sound_set_pitch(&engine, &sound, 1.0f);
ma_engine_sound_set_pan(&engine, &sound, 0.0f);
ma_engine_sound_set_looping(&engine, &sound, MA_TRUE);
ma_engine_sound_start(&engine, &sound);
ma_engine_sound_start(&engine, &sound, 4000);
ma_sleep(5000);
ma_engine_sound_stop(&engine, &sound, 4000);
#endif
#if 1
......
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment