Online computer courses, code, programming tutorial and sidebar information for monitoring Canadian S&P/TSX index. Build friendship and networking. Welcome to visit my blogs often!!! I also have two other sites: YouTube Channel and Google site.
Adsense
Popular Posts
- How to blend adsense inside your post?
- Formatting my post
- PHP: add a download as pdf file button in report page
- PHPWind-- A PHP forum script applcaition in China
- Notepad++ - Add C++ compiler
- PHP connect IBM db2 database in XAMPP
- Datatable export excel wraptext and newline
- phpexcel toggle expand and hide column in EXCEL and summary
- ActionScript 3.0 demo: create a falling snow in flash CS6
- Renew SSL certificate from StartSSL
Wednesday, October 23, 2013
Record voice using microphone and upload to server using flash and PHP
Below is to get the flash from Moodle LMS audio recording plugin and redesign PHP upload file.
Below is the snapshot of Moodle flash plugin interface:
1) Download moodle audio recording plugin:
https://moodle.org/plugins/pluginversions.php?plugin=assignment_onlineaudio
unzip and get onlineaudio folder, copy assests/recorder.swf to your working directory.
2) Embed recorder.swf:
<embed type="application/x-shockwave-flash" src="recorder.swf" id="recorder" name="recorder" quality="high" wmode="transparent" flashvars="gateway=simpleupload.php" height="276" width="430">
3) create simpleupload.php to process the sound file produced by recorder.swf:
<?php
$filename = preg_replace('/\s/', '', $_FILES['newfile']['name']);
$filetmpname = $_FILES['newfile']['tmp_name'];
$ok = move_uploaded_file($filetmpname, "C:\\LMS\\uploads\\".$filename);
?>
In this example, the upload file will be put in C:\LMS\uploads\
4) To displayand play the audio file (for example nn.mp3), I used the longtail_payer.swf from JW player:
<audio controls="controls">
<source src="nn.mp3" />
<!-- fallback -->
<embed type="application/x-shockwave-flash"
flashvars="audioUrl=nn.mp3"
src="longtail_player.swf"
width="650? height="0? quality="best"></embed>
</audio>`
5) For recorder using Flash Media server, refer to pRecorderTest. 115K Zip file in
http://flash-communications.net/sourcecode/index.html
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment