2 * Copyright (C) 2007, 2009, 2010, 2011 Free Software Foundation, Inc.
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 3 of the License, or
7 * (at your option) any later version.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 * You should have received a copy of the GNU General Public License
14 * along with this program; if not, write to the Free Software
15 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
20 * Test for streaming sound
27 #include <sys/types.h>
33 #include "ming_utils.h"
35 #define OUTPUT_VERSION 6
36 #define OUTPUT_FILENAME "streamingSoundTest1.swf"
40 main(int argc
, char** argv
)
46 const char* sound_filename
;
49 sound_filename
=MEDIADIR
"/click.mp3";
51 sound_f
= fopen(sound_filename
, "r");
53 perror(sound_filename
);
57 printf("Using sound file %s\n", sound_filename
);
59 if ( -1 == fstat(fileno(sound_f
), &statbuf
) )
64 if ( S_ISDIR(statbuf
.st_mode
) )
66 fprintf(stderr
, "%s is a directory, we need a file\n", sound_filename
);
71 Ming_useSWFVersion (OUTPUT_VERSION
);
74 SWFMovie_setDimension(mo
, 100, 100);
75 SWFMovie_setRate(mo
, 1);
77 ss
= newSWFSoundStream(sound_f
);
79 mc
= newSWFMovieClip();
80 SWFMovieClip_setSoundStream(mc
, ss
, 2);
81 SWFMovieClip_nextFrame(mc
);
82 SWFMovieClip_nextFrame(mc
);
83 SWFMovieClip_nextFrame(mc
);
84 SWFMovieClip_nextFrame(mc
);
87 SWFMovie_nextFrame(mo
);
88 SWFMovie_nextFrame(mo
);
89 SWFMovie_nextFrame(mo
);
90 SWFMovie_nextFrame(mo
);
91 SWFMovie_nextFrame(mo
);
92 SWFMovie_nextFrame(mo
);
93 SWFMovie_nextFrame(mo
);
94 SWFMovie_nextFrame(mo
);
97 puts("Saving " OUTPUT_FILENAME
);
98 SWFMovie_save(mo
, OUTPUT_FILENAME
);