mirror of
https://github.com/mackron/miniaudio.git
synced 2026-04-22 16:24:04 +02:00
Add support for setting the pitch on sound groups.
This commit is contained in:
@@ -35,10 +35,11 @@ int main(int argc, char** argv)
|
||||
|
||||
/*ma_data_source_seek_to_pcm_frame(sound.pDataSource, 5000000);*/
|
||||
|
||||
ma_engine_sound_group_set_pan(&engine, NULL, -1);
|
||||
//ma_engine_sound_group_set_pan(&engine, NULL, -1);
|
||||
ma_engine_sound_group_set_pitch(&engine, NULL, 1.0f);
|
||||
|
||||
/*ma_engine_sound_set_volume(&engine, &sound, 0.25f);*/
|
||||
ma_engine_sound_set_pitch(&engine, &sound, 1.0f);
|
||||
//ma_engine_sound_set_pitch(&engine, &sound, 2.0f);
|
||||
ma_engine_sound_set_pan(&engine, &sound, 0.0f);
|
||||
ma_engine_sound_set_looping(&engine, &sound, MA_TRUE);
|
||||
//ma_engine_sound_seek_to_pcm_frame(&engine, &sound, 6000000);
|
||||
@@ -47,7 +48,7 @@ int main(int argc, char** argv)
|
||||
//ma_engine_sound_set_fade_out(&engine, &sound, 2000);
|
||||
ma_engine_sound_start(&engine, &sound);
|
||||
|
||||
ma_sleep(5000);
|
||||
//ma_sleep(5000);
|
||||
//ma_engine_sound_stop(&engine, &sound);
|
||||
#endif
|
||||
|
||||
@@ -57,7 +58,7 @@ int main(int argc, char** argv)
|
||||
ma_engine_play_sound(&engine, argv[3], NULL);*/
|
||||
#endif
|
||||
|
||||
#if 0
|
||||
#if 1
|
||||
float pitch = 1;
|
||||
float pitchStep = 0.01f;
|
||||
float pitchMin = 0.125f;
|
||||
@@ -73,7 +74,9 @@ int main(int argc, char** argv)
|
||||
pitchStep = -pitchStep;
|
||||
}
|
||||
|
||||
//ma_engine_sound_group_set_pitch(&engine, NULL, pitch);
|
||||
ma_engine_sound_set_pitch(&engine, &sound, pitch);
|
||||
printf("Pitch: %f\n", pitch);
|
||||
|
||||
ma_sleep(1);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user