1 #include <libchimara/glk.h>
8 if(!glk_gestalt(gestalt_Sound, 0)) {
9 fprintf(stderr, "Sound not supported.\n");
12 if(!glk_gestalt(gestalt_SoundVolume, 0)) {
13 fprintf(stderr, "Sound volume not supported.\n");
17 schanid_t sc = glk_schannel_create(0);
19 fprintf(stderr, "Could not create sound channel.\n");
23 if(!glk_schannel_play(sc, 0)) { /* resource number doesn't matter right now */
24 fprintf(stderr, "Could not start sound channel.\n");
28 glk_schannel_set_volume(sc, 0x10000);
30 glk_schannel_set_volume(sc, 0x08000);
32 glk_schannel_set_volume(sc, 0x04000);
34 glk_schannel_set_volume(sc, 0x00000);
35 glk_schannel_set_volume(sc, 0xA0000); /* max supported volume */
36 glk_schannel_set_volume(sc, 0xB0000); /* should be coerced */
37 glk_schannel_set_volume(sc, 0x10000);
39 glk_schannel_stop(sc);
40 glk_schannel_destroy(sc);