looping mp3 and movie rate

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I am running Ming 0.4.2 and have been trying to incorporate a looping mp3 into flash files using one of the examples from gazbming.com.
 
The gazbming streammp3 example below works great but only as long as the movie speed remains set to 31. I need to incorporate looping mp3 files into movies created through a banner builder where the Movie setRate=12. Is there any way to do this? If I reduce the movie rate in the example below down to 12, the file plays the mp3 OK but will give roughly 3 minutes without sound before looping again. When setRate goes back to 31 it loops fine. 
 
Any help in figuring out how to get this example to work with 12 as the movie setRate instead of 31 would be greatly appreciated.
 
<?
/********************************************************************************
* @ File: streammp3.php
* @ Original date: October 2003 @ www16.brinkster.com/gazb/ming/
* @ Version: 1.2
* @ Summary: mp3 streaming with ming
* @ Updated:  small improvements and summary text
* @ Copyright (c) 2003-2007, www.gazbming.com - all rights reserved.
* @ Author: gazb.ming [[@]] gmail.com - www.gazbming.com 
* @ Released under GNU Lesser General Public License - http://www.gnu.org/licenses/lgpl.html
********************************************************************************/

// some typical movie variables
Ming_setScale(20.0000000);
ming_useswfversion(6);
$movie=new SWFMovie();
$movie->setDimension(550,400);
$movie->setBackground(rand(0,0xFF),rand(0,0xFF),rand(0,0xFF));
$movie->setRate(31); 

// move along a few frames
for($i=0;$i<5;$i++){$movie->nextFrame();}

// open the mp3 file
$snd = fopen("boomb.mp3", "rb");

// add the mp3 to the movie
$stream=$movie->streamMp3($snd);

// close the mp3 file
fclose($snd);

// add enough frames to movie for stream to work
for($i=0;$i<$stream;$i++){
$movie->nextFrame();
}

// save swf with same name as filename
$swfname = basename(__FILE__,".php");
$movie->save("$swfname.swf",9);
?>
------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with 
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Ming-users mailing list
Ming-users@xxxxxxxxxxxxxxxxxxxxx
https://lists.sourceforge.net/lists/listinfo/ming-users

[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux