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
- Using Cron Job to process PHP scripts
- job interview questions (1)
- PHP connect IBM db2 database in XAMPP
- Datatable export excel wraptext and newline
- Install PHPMailer 5.2.4 and use smtp gmail
- Set up a child account and set screen time limit in Windows 8
- Powerful js library datable to export table in pdf, excel, sorting, freezing column and table header fixed (sticky)
- Free host forum is not reliable
- PHP - Export Content to MS Word document
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