mirror of
https://github.com/mackron/miniaudio.git
synced 2026-04-24 01:04:02 +02:00
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.
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user