add a sound when something is inserted in mysql

0

How can I execute a sound (beep) on the computer when I have a php web in the browser and when a data is inserted in a table in mysql, for example: I have an open php web and a new message arrives, how to do it emit some sound the web that indicates to me that something has been inserted in BD mysql, to do a where when in mysql there is a new value, to emit a sound (as I call a wav or mp3 file and to run in php)

    
asked by Ivan Diaz Perez 06.04.2017 в 17:55
source

1 answer

0

I think you could use the class SWFSound you can see the documentation here.

link

This is an example that comes on the same page:

<?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");
    
answered by 06.04.2017 в 18:13