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 
10 		file = fopen(MEDIADIR "/sound1.mp3", "rb");
11                 if(!file) {
12                         return EXIT_FAILURE;
13                 }
14 
15 		m->setRate(1);
16 
17 		SWFMovieClip *mc = new SWFMovieClip();
18 		SWFSoundStream *stream = new SWFSoundStream(file);
19 		mc->setSoundStream(stream, 1);
20 		mc->nextFrame();
21 		mc->nextFrame();
22 
23 		m->add(mc);
24 		m->nextFrame();
25 		m->save("test01.swf");
26 	}
27 	catch(SWFException &e)
28 	{
29 		std::cerr << "SWFException: " << e.what() << std::endl << std::endl;
30                 return EXIT_FAILURE;
31 	}
32 	return EXIT_SUCCESS;
33 }
34