Deprecated: Optional parameter $keys declared before required parameter $cms_id is implicitly treated as a required parameter in /home/www/dev/work/class/blog/CmsKey.php on line 75

Deprecated: Creation of dynamic property lvesu\lvesu\controller\blog\php::$title is deprecated in /home/www/dev/work/website/lvesu/class/controller/blog/php.php on line 28

Deprecated: Creation of dynamic property lvesu\lvesu\controller\blog\php::$outlink is deprecated in /home/www/dev/work/website/lvesu/template/blog/cms/php.manual.tpl on line 2

Deprecated: Creation of dynamic property lvesu\lvesu\controller\blog\php::$status is deprecated in /home/www/dev/work/website/lvesu/template/blog/index.head.php on line 2
PHP - Manual: SWFSound - 互联网笔记

略微加速

PHP官方手册 - 互联网笔记

PHP - Manual: SWFSound

2025-06-09

The SWFSound class

(PHP 5 < 5.3.0, PECL ming SVN)

简介

SWFSound.

类摘要

SWFSound {
/* 方法 */
__construct ( string $filename [, int $flags = 0 ] )
}

Table of Contents

add a note add a note

User Contributed Notes 1 note

up
0
egonbraun a t gmail d o t c o m
10 years ago
Just an example of how to use this class. It just cerates a serie of three images with a background sound in each one of them.

<?php
    $movie
= new SWFMovie();
   
$movie->setRate(1);

   
$img1 = new SWFBitmap(fopen('./tmp/img1.jpg', 'rb'));
   
$img2 = new SWFBitmap(fopen('./tmp/img2.jpg', 'rb'));
   
$img3 = new SWFBitmap(fopen('./tmp/img3.jpg', 'rb'));
   
$snd1 = new SWFSound(fopen('./tmp/1.wav', 'rb'), SWF_SOUND_22KHZ|SWF_SOUND_16BITS|SWF_SOUND_MONO);
   
$snd2 = new SWFSound(fopen('./tmp/2.wav', 'rb'), SWF_SOUND_22KHZ|SWF_SOUND_16BITS|SWF_SOUND_MONO);
   
$snd3 = new SWFSound(fopen('./tmp/3.wav', 'rb'), SWF_SOUND_22KHZ|SWF_SOUND_16BITS|SWF_SOUND_MONO);

   
$s = $movie->startSound($snd1);
   
$s->loopcount(1);
   
$s->loopinpoint(1 * 100);

   
$i = $movie->add($img1);
   
$i->setDepth(1);
   
$movie->nextFrame();
   
   
$s = $movie->startSound($snd2);
   
$s->loopcount(1);
   
$s->loopinpoint(1 * 100);
   
   
$i = $movie->add($img2);
   
$i->setDepth(2);
   
$movie->nextFrame();
   
   
$s = $movie->startSound($snd3);
   
$s->loopcount(1);
   
$s->loopinpoint(1 * 100);
   
   
$i = $movie->add($img3);
   
$i->setDepth(3);
   
$movie->nextFrame();

   
$movie->setBackground(0xff, 0xff, 0xff);
   
$movie->setDimension(130, 97);
   
$movie->add(new SWFAction("gotoFrame(0); play();"));
   
$movie->nextFrame();

   
$movie->save("bw.swf");
?>

官方地址:https://www.php.net/manual/en/class.swfsound.php

冷却塔厂家 广告
中文GPT4.0无需注册 广告
北京半月雨文化科技有限公司.版权所有 京ICP备12026184号-3