PHP Coding
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Codewalkers ForumsPHP RelatedPHP Coding

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Codewalkers Forums Sponsor:
  #1  
Old October 20th, 2009, 11:51 AM
Naughty Naughty is offline
Contributing User
Click here for more information.
 
Join Date: Jul 2009
Posts: 83 Naughty User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 13 h 53 m 8 sec
Reputation Power: 1
Question To play a .wav file

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!

Reply With Quote
  #2  
Old October 20th, 2009, 01:42 PM
IAmALlama IAmALlama is offline
Me
Click here for more information. Click here for more information
Click here for more information
 
Join Date: Apr 2007
Location: Seattle, WA
Posts: 1,937 IAmALlama User rank is Private First Class (20 - 50 Reputation Level)IAmALlama User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: 1 Week 5 Days 1 h 54 m 18 sec
Reputation Power: 4
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.

Reply With Quote
  #3  
Old October 20th, 2009, 02:00 PM
Naughty Naughty is offline
Contributing User
Click here for more information.
 
Join Date: Jul 2009
Posts: 83 Naughty User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 13 h 53 m 8 sec
Reputation Power: 1
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 )

Reply With Quote
  #4  
Old October 20th, 2009, 02:28 PM
IAmALlama IAmALlama is offline
Me
Click here for more information. Click here for more information
Click here for more information
 
Join Date: Apr 2007
Location: Seattle, WA
Posts: 1,937 IAmALlama User rank is Private First Class (20 - 50 Reputation Level)IAmALlama User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: 1 Week 5 Days 1 h 54 m 18 sec
Reputation Power: 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.

Reply With Quote
  #5  
Old October 20th, 2009, 02:42 PM
Naughty Naughty is offline
Contributing User
Click here for more information.
 
Join Date: Jul 2009
Posts: 83 Naughty User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 13 h 53 m 8 sec
Reputation Power: 1
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?

Reply With Quote
  #6  
Old October 20th, 2009, 04:34 PM
IAmALlama IAmALlama is offline
Me
Click here for more information. Click here for more information
Click here for more information
 
Join Date: Apr 2007
Location: Seattle, WA
Posts: 1,937 IAmALlama User rank is Private First Class (20 - 50 Reputation Level)IAmALlama User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: 1 Week 5 Days 1 h 54 m 18 sec
Reputation Power: 4
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.

Reply With Quote
  #7  
Old October 21st, 2009, 09:42 AM
Naughty Naughty is offline
Contributing User
Click here for more information.
 
Join Date: Jul 2009
Posts: 83 Naughty User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 13 h 53 m 8 sec
Reputation Power: 1
PHP Code:
<?php
$text 
"Hello, your class has been canceled, we apologize for this inconvenience. Thank you";
$VoiceObj = new COM("SAPI.SpVoice");
$VoiceObj->Speak($text);
?>


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

Reply With Quote
  #8  
Old October 21st, 2009, 12:39 PM
IAmALlama IAmALlama is offline
Me
Click here for more information. Click here for more information
Click here for more information
 
Join Date: Apr 2007
Location: Seattle, WA
Posts: 1,937 IAmALlama User rank is Private First Class (20 - 50 Reputation Level)IAmALlama User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: 1 Week 5 Days 1 h 54 m 18 sec
Reputation Power: 4
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.

Reply With Quote
Reply

Viewing: Codewalkers ForumsPHP RelatedPHP Coding > To play a .wav file


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump




 Free IT White Papers!
 
How to Present Effectively Online
This white paper offers practical and actionable advice on the key steps that any presenter should consider as they plan and execute a Webinar or online meeting.

Request Your Free Technology Downloads!
 
Open Source Security Myths
Open Source Software (OSS) is computer software whose source code is available to the general public with relaxed or non-existent intellectual property restrictions (or arrangement such as the public domain), and is usually developed with the input of many contributors.

Request Your Free Technology Downloads!
 
Power and Cooling Capacity Management for Data Centers
This paper describes the principles for achieving power and cooling capacity management.

Request Your Free Technology Downloads!
 
Scalable, Fault-Tolerant NAS for Oracle - The Next Generation
For several years NAS has been evolving as a storage alternative for Oracle databases, and for good reason: NAS is quite often the simplest, most cost-effective storage approach for Oracle. Learn about the benefits that HP's approach to scalable NAS brings to Oracle environments in this comprehensive white paper.

Request Your Free Technology Downloads!
 
Understanding Web Application Security Challenges
This white paper discusses many common threats and preventive measures for Web application security, and explains what you can do to help protect your organization.

Request Your Free Technology Downloads!
 

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 




© 2003-2009 by Developer Shed. All rights reserved. DS Cluster 1 Hosted by Hostway
For more Enterprise Application Development news, visit eWeek