📄 function.swfmovie.streammp3.html
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"><html> <head> <title>Streams a MP3 file</title> <meta http-equiv="content-type" content="text/html; charset=UTF-8"> </head> <body><div style="text-align: center;"> <div class="prev" style="text-align: left; float: left;"><a href="function.swfmovie.stopsound.html">SWFMovie->stopSound</a></div> <div class="next" style="text-align: right; float: right;"><a href="function.swfmovie.writeexports.html">SWFMovie->writeExports</a></div> <div class="up"><a href="class.swfmovie.html">SWFMovie</a></div> <div class="home"><a href="index.html">PHP Manual</a></div></div><hr /><div id="function.swfmovie.streammp3" class="refentry"> <div class="refnamediv"> <h1 class="refname">SWFMovie->streamMP3</h1> <p class="verinfo">(No version information available, might be only in CVS)</p><p class="refpurpose"><span class="refname">SWFMovie->streamMP3</span> — <span class="dc-title">Streams a MP3 file</span></p> </div> <div class="refsect1 description"> <h3 class="title">Description</h3> <div class="classsynopsis"> <div class="ooclass"><a href="class.swfmovie.html" class="classname">SWFMovie</a></div> <div class="methodsynopsis dc-description"> <span class="type">int</span> <span class="methodname"><b><b>streamMP3</b></b></span> ( <span class="methodparam"><span class="type"><a href="language.pseudo-types.html#language.types.mixed" class="type mixed">mixed</a></span> <tt class="parameter">$mp3file</tt></span> [, <span class="methodparam"><span class="type">float</span> <tt class="parameter">$skip</tt></span> ] )</div> </div> <div class="warning"><b class="warning">Warning</b><p class="simpara">This function is<em class="emphasis">EXPERIMENTAL</em>. The behaviour of this function, its name, andsurrounding documentation may change without notice in a future release of PHP.This function should be used at your own risk.</p></div> <p class="para"> Streams the given MP3 file <i><tt class="parameter">mp3file</tt></i>. </p> <p class="para"> This method is not very robust in dealing with oddities (can skip over an initial ID3 tag, but that's about it). </p> <p class="para"> Note that the movie isn't smart enough to put enough frames in to contain the entire mp3 stream- you'll have to add (length of song * frames per second) frames to get the entire stream in. </p> </div> <div class="refsect1 parameters"> <h3 class="title">Parameters</h3> <p class="para"> <dl> <dt> <span class="term"><i><tt class="parameter">mp3file</tt></i></span> <dd> <p class="para"> Can be a file pointer returned by <a href="function.fopen.html" class="function">fopen()</a> or the MP3 data, as a binary string. </p> </dd> </dt> <dt> <span class="term"><i><tt class="parameter">skip</tt></i></span> <dd> <p class="para"> Number of seconds to skip. </p> </dd> </dt> </dl> </p> </div> <div class="refsect1 returnvalues"> <h3 class="title">Return Values</h3> <p class="para"> Return number of frames. </p> </div> <div class="refsect1 changelog"> <h3 class="title">ChangeLog</h3> <p class="para"> <table class="informaltable"> <colgroup> <thead valign="middle"> <tr valign="middle"> <th colspan="1">Version</th> <th colspan="1">Description</th> </tr> </thead> <tbody valign="middle" class="tbody"> <tr valign="middle"> <td colspan="1" rowspan="1" align="left">5.2.0</td> <td colspan="1" rowspan="1" align="left"><i><tt class="parameter">skip</tt></i> added</td> </tr> </tbody> </colgroup> </table> </p> </div> <div class="refsect1 examples"> <h3 class="title">Examples</h3> <p class="para"> <div class="example"> <p><b>Example #1 Streaming example</b></p> <div class="example-contents"><div class="phpcode"><code><span style="color: #000000"><span style="color: #0000BB"><?php<br />$m </span><span style="color: #007700">= new </span><span style="color: #0000BB">SWFMovie</span><span style="color: #007700">();<br /></span><span style="color: #0000BB">$m</span><span style="color: #007700">-></span><span style="color: #0000BB">setRate</span><span style="color: #007700">(</span><span style="color: #0000BB">12.0</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">$m</span><span style="color: #007700">-></span><span style="color: #0000BB">streamMp3</span><span style="color: #007700">(</span><span style="color: #0000BB">file_get_contents</span><span style="color: #007700">(</span><span style="color: #DD0000">"distortobass.mp3"</span><span style="color: #007700">));<br /></span><span style="color: #FF8000">// use your own MP3<br /><br />// The file is 11.85 seconds at 12.0 fps = 142 frames<br /></span><span style="color: #0000BB">$m</span><span style="color: #007700">-></span><span style="color: #0000BB">setFrames</span><span style="color: #007700">(</span><span style="color: #0000BB">142</span><span style="color: #007700">);<br /><br /></span><span style="color: #0000BB">header</span><span style="color: #007700">(</span><span style="color: #DD0000">'Content-type: application/x-shockwave-flash'</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">$m</span><span style="color: #007700">-></span><span style="color: #0000BB">output</span><span style="color: #007700">();<br /></span><span style="color: #0000BB">?></span></span></code></div> </div> </div> </p> </div></div><hr /><div style="text-align: center;"> <div class="prev" style="text-align: left; float: left;"><a href="function.swfmovie.stopsound.html">SWFMovie->stopSound</a></div> <div class="next" style="text-align: right; float: right;"><a href="function.swfmovie.writeexports.html">SWFMovie->writeExports</a></div> <div class="up"><a href="class.swfmovie.html">SWFMovie</a></div> <div class="home"><a href="index.html">PHP Manual</a></div></div></body></html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -