void main()
{
say("`%Media test", &current_sprite)
}

void hit()
{
say("`%Ouch!", &current_sprite)
}

void talk()
{
freeze(1)
choice_start()
"Play a video"
"Play a tracker module"
"Play a SNES SPC"
"Play a repeating WAV with volume control"
"Play an Ogg Vorbis as SFX"
"Play an MP3 SFX"
choice_end()

if (&result == 1)
{
	playavi("anim/fireworks.mp4");
	say_stop("`%Something should have popped up", &current_sprite)
		say_stop("`%If you have ffmpeg installed", &current_sprite)
}

if (&result == 2)
{
	playmidi("drax.xm")
		say_stop("`%If the bgm hasn't changed, it's a mystery", &current_sprite);
	wait(2000)
		say_stop("`%Now let's test pattern-setting", &current_sprite)
			play_mod_order(0)
}

if (&result == 3)
{
	playmidi("ruins.spc")
		say_stop("`%If Yeoldedink was compiled with MixerX you should be hearing the power of libGME", &current_sprite)
			say_stop("`%by now", &current_sprite)
}

if (&result == 4)
{
say_stop("`%Playing WAV", &current_sprite);
stopmidi();
int &crap;
&crap = playsound(53, 0, 0, 0, 1);
wait(2000)
say("`%Attenuating volume", &current_sprite)
sound_set_vol(&crap, -1500);
wait(4000)
say("`%Attempting to set normal volume", &current_sprite)
sound_set_vol(&crap, 10000)
wait(18000)
sound_set_kill(&crap);
say("`%Done!", &current_sprite)
}

if (&result == 5)
{
	say_stop("`%Playing Ogg Vorbis SFX", &current_sprite)
	stopmidi();
	int &sfx;
	&sfx = playsound(55, 0, 0, 0, 1)
	sound_set_survive(&sfx, 1);
	wait(500)
	say_stop("`%This will loop indefinitely", &current_sprite)
	wait(100)
	say_stop("`%And should survive a screen change", &current_sprite)
}

if (&result == 6)
{
	say("`%Playing MP3 as SFX, no loop", &current_sprite)
	stopmidi();
	int &mpeg;
	&mpeg = playsound(57, 0, 0, 0, 0)
}

unfreeze(1)
}
