mirror of
https://github.com/mackron/miniaudio.git
synced 2026-04-23 16:54:03 +02:00
Only set the isPlaying flag when the audio has finished playing.
This commit is contained in:
@@ -71,12 +71,14 @@ int main(int argc, char** argv)
|
||||
return -1;
|
||||
}
|
||||
|
||||
#if 1
|
||||
result = ma_sound_init_from_file(&engine, argv[1], MA_DATA_SOURCE_FLAG_DECODE | MA_DATA_SOURCE_FLAG_ASYNC /*| MA_DATA_SOURCE_FLAG_STREAM*/, &loadNotification, NULL, &sound2);
|
||||
if (result != MA_SUCCESS) {
|
||||
printf("Failed to load sound: %s\n", argv[1]);
|
||||
ma_engine_uninit(&engine);
|
||||
return -1;
|
||||
}
|
||||
#endif
|
||||
|
||||
/*ma_data_source_seek_to_pcm_frame(sound.pDataSource, 5000000);*/
|
||||
|
||||
@@ -90,11 +92,11 @@ int main(int argc, char** argv)
|
||||
//ma_sound_set_looping(&sound, MA_TRUE);
|
||||
//ma_sound_seek_to_pcm_frame(&sound, 6000000);
|
||||
//ma_sound_set_start_delay(&sound, 1110);
|
||||
ma_sound_set_volume(&sound, 0.0f);
|
||||
ma_sound_set_volume(&sound, 0.5f);
|
||||
//ma_sound_set_fade_point_in_milliseconds(&sound, 0, 0, 1, 0, 2000);
|
||||
//ma_sound_set_fade_point_auto_reset(&sound, 0, MA_FALSE); /* Enable fading around loop transitions. */
|
||||
//ma_sound_set_fade_point_auto_reset(&sound, 1, MA_FALSE);
|
||||
ma_sound_set_stop_delay(&sound, 1000);
|
||||
//ma_sound_set_stop_delay(&sound, 1000);
|
||||
ma_sound_start(&sound);
|
||||
|
||||
//ma_sleep(1000);
|
||||
|
||||
Reference in New Issue
Block a user