1 #include <mingpp.h> 2 #include <cstdlib> 3 main()4int 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 stream->setInitialMp3Delay(16384); 19 mc->setSoundStream(stream, m->getRate()); 20 for(i = 0; i < 200; i++) 21 mc->nextFrame(); 22 23 m->add(mc); 24 m->nextFrame(); 25 m->save("test03.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