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
- PHPWind-- A PHP forum script applcaition in China
- How to blend adsense inside your post?
- Formatting my post
- PHP: add a download as pdf file button in report page
- Datatable export excel wraptext and newline
- Set up a child account and set screen time limit in Windows 8
- Sweet Alert JS library - beautiful replacement of JavaScript Alert
- Install PHPMailer 5.2.4 and use smtp gmail
- Install PHP ibm_db2 extension in Linux (redHat)
- Promote your Forum/Blog/Website via major search Engines
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