Add support for setting the pitch on sound groups.

This commit is contained in:
David Reid
2020-08-16 15:20:35 +10:00
parent 41198b9b75
commit 22a785d72b
2 changed files with 70 additions and 28 deletions
+7 -4
View File
@@ -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);
}