mirror of
https://github.com/mackron/miniaudio.git
synced 2026-04-23 00:34:03 +02:00
Work in progress on the new high level API.
* Early work on asynchronously decoding into a memory buffer. This is
just an early implementation - there are still issues needing to be
figured out. In particular, sounds do not automatically start until
the entire file has been decoded. It would be good if they could
start as soon as the first second or so of data has been decoded.
This commit is contained in:
@@ -28,20 +28,23 @@ int main(int argc, char** argv)
|
||||
return -1;
|
||||
}
|
||||
|
||||
result = ma_engine_sound_init_from_file(&engine, argv[1], MA_DATA_SOURCE_FLAG_DECODE, NULL, &sound);
|
||||
result = ma_engine_sound_init_from_file(&engine, argv[1], MA_DATA_SOURCE_FLAG_DECODE | MA_DATA_SOURCE_FLAG_ASYNC, NULL, &sound);
|
||||
if (result != MA_SUCCESS) {
|
||||
ma_engine_uninit(&engine);
|
||||
return -1;
|
||||
}
|
||||
|
||||
ma_engine_sound_set_volume(&engine, &sound, 0.25f);
|
||||
ma_engine_sound_set_pitch(&engine, &sound, 1.0f);
|
||||
ma_engine_sound_set_pan(&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_play_sound(&engine, argv[1], NULL);
|
||||
#if 1
|
||||
/*ma_engine_play_sound(&engine, argv[1], NULL);*/
|
||||
ma_engine_play_sound(&engine, argv[2], NULL);
|
||||
ma_engine_play_sound(&engine, argv[3], NULL);
|
||||
#endif
|
||||
|
||||
#if 0
|
||||
float pitch = 1;
|
||||
|
||||
Reference in New Issue
Block a user