! Compile this into a blorb file of your own compilation. Constant STORY "SoundTest"; constant Headline "GWindows Sound System demo^By L. Ross Raszewski"; include "gcdefs"; include "parser"; include "verblib"; include "gsound"; include "grammar"; Object arm "A Room" with description "This is a room." has light; GSChannel ac; GSMusicChannel mc with number GS_LOOP_FOREVER; [initialise; location= arm; "^^Welcome to the GWindows Sound System Demo. Type ~PLAY X~ to play sound X in the multichannel. Type ~LOOP X~ to play sound X looped in the music channel (LOOP 0 stops it). Type ~ALT X~ to play sound X in the secondary channel. Type ~STATUS~ to find out how the channels are doing.^^"; ]; [ playitsub; if (GSMultiChannel.play(noun)) "Sound is playing."; else "Sound did not start."; ]; verb 'play' * number -> playit; [ musicitsub; if (noun==0) { mc.cancel(); print "Stopped."; } if (mc.play(noun)) "Music is playing."; else "Music is not playing."; ]; verb 'loop' * number -> musicit; [ altitsub; if (ac.play(noun)) "Sound is playing."; else "Sound is not playing."; ]; verb 'alt' * number -> altit; [ statsub o i j; objectloop(o in GSMultichannel) { if (o has on) i++; if (o has open) j++; } print "There are ", children(GSMultichannel), " virtual channels installed in the multichannel; ", j, " are initialized, and ", i, " are playing.^ The music channel is "; if (mc has on) print "playing sound #", mc.playing; else if (mc has open) print "silent, but initialized"; else print "not active"; print ".^The alternate channel is "; if (ac has on) print "playing sound #", ac.playing; else if (ac has open) "silent, but initialized"; else "not active"; print ".^"; if (~~(GS_ABILITIES & GS_NTFYOK)) "Warning: Sound notifications are not available. The preceeding statistics may not be accurate."; ]; verb 'status' * -> stat;