1#!/usr/bin/perl 2use strict; 3 4#use lib("/home/peter/ming3/lib/perl5/site_perl"); 5 6$|=1; 7use SWF qw(:ALL); 8use SWF::Constants qw(SWF_SOUND_22KHZ SWF_SOUND_11KHZ SWF_SOUND_16BITS SWF_SOUND_8BITS SWF_SOUND_MONO); 9 10my $soundfile="../common/beep.wav"; 11 12# some misuse of one wavfiles ;-) 13my $sound = new SWF::Sound($soundfile, SWF_SOUND_22KHZ|SWF_SOUND_8BITS|SWF_SOUND_MONO); 14my $sound2 = new SWF::Sound($soundfile, SWF_SOUND_11KHZ|SWF_SOUND_8BITS|SWF_SOUND_MONO); 15 16 17my $m = new SWF::Movie(); 18$m->setDimension(200, 100); 19$m->setBackground(0xff, 0xff, 0x0); 20$m->setRate(12.0); 21 22 23# now let's do some funny noisepattern... 24my $soundinstance=$m->startSound($sound); 25$soundinstance->loopCount(20); 26$soundinstance->loopOutPoint(20000); 27$soundinstance->noMultiple(); 28$m->nextFrame(); 29 30 31for(0..5){ 32 $m->nextFrame(); 33} 34my $soundinstance2=$m->startSound($sound2); 35$soundinstance2->loopCount(20); 36$soundinstance2->loopInPoint(0); 37$soundinstance2->loopOutPoint(4000); 38$soundinstance2->noMultiple(); 39 40for(0..5){ 41 $m->nextFrame(); 42} 43 44# decide if its called from commandline or as cgiscript 45if (exists $ENV{"REQUEST_URI"}){ 46 print "Content-type: application/x-shockwave-flash\n\n"; 47 $m->output(); 48} 49else { 50 $m->save("$0.swf"); 51 print "Generated file written to $0.swf\n"; 52} 53