1 #include <mingpp.h>
2 #include <cstdlib>
3 
main()4 int main()
5 {
6 	try {
7 		SWFMovie *m = new SWFMovie(7);
8 		FILE *file;
9 		int i;
10 
11 		file = fopen(MEDIADIR "/audio01.mp3", "rb");
12                 if(!file) {
13                         return EXIT_FAILURE;
14                 }
15 
16 		SWFMovieClip *mc = new SWFMovieClip();
17 		SWFSoundStream *stream = new SWFSoundStream(file);
18 		mc->setSoundStream(stream, m->getRate());
19 		for(i = 0; i < 200; i++)
20 			mc->nextFrame();
21 
22 		m->add(mc);
23 		m->nextFrame();
24 		m->save("test02.swf");
25 	}
26 	catch(SWFException &e)
27 	{
28 		std::cerr << "SWFException: " << e.what() << std::endl << std::endl;
29                 return EXIT_FAILURE;
30 	}
31 	return EXIT_SUCCESS;
32 }
33