|
|
|
| ||||||||||||||||||||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Hey,
Is it possible for a PHP page to play a .wav file that which was uploaded in the previous page. For example if I have uploaded a wave file in page1.php, on submit I'll be directed to page2.php, where one of my requirement is to play the wav file uploaded on page1. If YES, how to write the PHP code for it? Help me! |
|
#2
|
|||
|
|||
|
you would be best to do something like this in flash. Flash should be able to play wav files easily. It would just be a matter of making a flash component/object that takes in a file name, loads the file and plays it. Possibly using some sort of streaming so the visitor doesn't have to wait for it to load completely.
|
|
#3
|
|||
|
|||
|
But this play requirement is a part of my PHP page, how can I use action script in it?
Moreover I don't know action script at all. Is it possible to convert the text I enter in the text box in 1st page ( i.e.page1.php ) to gsm or .wav file in PHP on page2.php ? ( other requirement apart from wav file ) |
|
#4
|
|||
|
|||
|
you want to do some sort of text to sound conversion? you would probably need to use an external program to do the conversion. As for playing the file, flash would be the easiest way, or you can embed the sound but that would require a browser plugin like windows media player or quicktime to play the sound.
|
|
#5
|
|||
|
|||
|
Yup, text to sound conversion. What's the external program I could use?
How can I embed the sound to work along with browser? Is it through coding? |
|
#6
|
|||
|
|||
|
to add the sound to the page, its just simple html. google for "html embed wav" for details. And for the text to speech conversion, I don't know of a program but I just googled "php text to speech" and came back with a few hits. I don't have time today to research them for you, but you should be able to.
|
|
#7
|
|||
|
|||
|
PHP Code:
This code worked well for text-to-speech conversion, once I run on the browser http://localhost/speech.php. But I was unsure of adding play and stop button, coz this start immediately I load the page. Any idea how I can do that. For the wav file I think the embed tag would work, <EMBED src="file.wav" autostart=true loop=false volume=100 hidden=true></EMBED> Where I felt the auto start should be false in my case, to listen only on play button and stop on stop button. Once I solve the above problem, I'll post my code of what I'm trying to do coz I have few clarification to be made. Thanks |
|
#8
|
|||
|
|||
|
well if you don't want it to start automatically, you could change autostart to false...
and I believe if you want to see the controls, change hidden to false. however this is just off the top of my head. |
![]() |
| Viewing: Codewalkers Forums > PHP Related > PHP Coding > To play a .wav file |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|