Difference between revisions of "MP3 player"

Jump to: navigation, search

Note: You are currently viewing documentation for Moodle 2.2. Up-to-date documentation for the latest stable version is available here: MP3 player.

m (Reverted edit of Julli9, changed back to last version by Tsala)
(removed update template)
 
(48 intermediate revisions by 15 users not shown)
Line 1: Line 1:
The multimedia filter embeds MP3 files in a streaming player made with Flash. The big MP3 player is used when an MP3 file is added as a [[Resources|resource]] e.g. [http://moodle.org/mod/resource/view.php?id=2296 Moodle Features Demo: MP3 file]. The small player is used when an MP3 file is linked to from within a forum post or another resource or activity using the [[HTML editor]].
+
{{Working with media}}
  
==MP3 player rates==
+
The multimedia filter embeds MP3 files in a streaming player made with Flash. The big MP3 player is used when an MP3 file is added as a [[Resources|resource]]. The small player is used when an MP3 file is linked to from within a forum post or another resource or activity using the [[HTML editor]].
  
To ensure that MP3 files are played at the correct rate, sample rates of 11, 22 or 44 kHz should be used.
+
==MP3 sample rates==
  
==Flash security settings==
+
11.025, 22.050 and 44.100 kHz are acceptable sample rates but it is recommended to  use only 44.100 kHz (for both, music and speech recordings). The reason is that using a lower sampling rate will have very little effect on the final mp3 file size (bit rates have a bigger impact) but quality will decrease noticeably.
  
Security changes in Flash player 7 may result in the MP3 player not playing MP3 files hosted on a remote server. This issue may be resolved by writing a cross-domain policy for the remote server and/or each user changing their global security settings in the Flash player settings manager.
+
==MP3 bit rates==
 +
Flash player 9 is no longer limited and can play audio files with the maximum MP3 bit rate, that is 320 kbps.
 +
However, while Flash player is not limited anymore, it is  recommend to use only one of the following:
  
===Cross-domain policy===
+
-- 96 kbps for speech audio files (if file size is critical, 64 kbps could still be acceptable), as this will avoid having very low quality recordings.
  
To create a cross-domain policy, save the code below as ''crossdomain.xml'' and place the file at the root of the remote server.
+
-- 128 kbps for music (but not higher than that, as most people cannot differentiate between a 128 kbps file and a higher one).
  
<cross-domain-policy>
+
It is also recommended to always encode using "Joint stereo" (not "Stereo"), as this will either improve quality or reduce filesize.
    <allow-access-from domain="www.yourmoodlesite.org" />
 
</cross-domain-policy>
 
  
Please refer to [http://www.macromedia.com/devnet/flash/articles/fplayer_security.html Macromedia - Developer Center: Security Changes in Macromedia Flash Player 7] for further details.
+
==Flash security and Cross domain policy==
  
===Global security settings===
+
Here are up to date articles on policy file changes in Flash 9 and 10 and on Cross domain policy file usage:
  
Please refer to [http://www.macromedia.com/support/documentation/en/flashplayer/help/settings_manager02.html Macromedia - Flash Player Help: Global Privacy Settings Panel].
 
  
==MP3 player colours==
+
[http://www.adobe.com/devnet/flashplayer/articles/fplayer9_security.html Policy file changes in Flash Player 9 and Flash Player 10]
  
''theme/yourtheme/config.php'' contains options for changing the default colours (black, white and grey) of the MP3 player.
+
[http://www.adobe.com/devnet/flashplayer/articles/cross_domain_policy.html Cross-domain policy file usage recommendations for Flash Player]
  
$THEME->resource_mp3player_colors =
+
[http://www.adobe.com/devnet/articles/crossdomain_policy_file_spec.html Cross-domain policy file specification]
  'bgColour=000000&btnColour=ffffff&btnBorderColour=cccccc&iconColour=000000&'.
 
  'iconOverColour=00cc00&trackColour=cccccc&handleColour=ffffff&loaderColour=ffffff&'.
 
  'font=Arial&fontColour=3333FF';
 
/// With this you can control the colours of the "big" MP3 player
 
/// that is used for MP3 resources.
 
  
$THEME->filter_mediaplugin_colors =
+
[http://www.adobe.com/devnet/flashplayer/articles/flash_player10_security_wp.html White paper: Adobe Flash Player 10 security]
  'bgColour=000000&btnColour=ffffff&btnBorderColour=cccccc&iconColour=000000&'.
 
  'iconOverColour=00cc00&trackColour=cccccc&handleColour=ffffff&loaderColour=ffffff&';
 
/// ...And this controls the small embedded player
 
  
==MP3 playback options==
+
===MP3 Encoder===
  
''theme/yourtheme/config.php'' contains options for changing the playback options of the MP3 player.
+
[http://lame.sourceforge.net/ LAME]s a high quality MPEG Audio Layer III (MP3) encoder licensed under the LGPL.
  
* <code>waitForPlay</code> determines whether the MP3 file starts downloading as soon as the player appears on the page (<code>waitForPlay=no</code>), or whether the play button must be pressed before the MP3 file starts downloading (<code>waitForPlay=yes</code>).
+
==MP3 player customisation==
  
* <code>autoPlay</code> determines whether the MP3 player starts playing the MP3 as soon as the player appears on the page (<code>autoPlay=yes</code>), or whether it must be fully downloaded before playing (<code>autoPlay=no</code>).
+
It is possible to customise the colours of the the MP3 player via CSS included in the theme. For example
  
* <code>buffer</code> determines how many seconds of the MP3 file must be downloaded before the MP3 starts playing e.g. 10 seconds (<code>buffer=10</code>).
+
<code>
 +
.mp3flowplayer_backgroundColor {color: #000000;}
 +
</code>
  
'''Default playback options'''
+
modifies the background colour, see http://flowplayer.org/documentation/skinning/controlbar.html?skin=default for more colour properties, any property that ends with '...Color' can be overridden via CSS.
  
* Big MP3 player: <code>buffer=10&waitForPlay=no&autoPlay=yes</code>
+
For accessibility reasons it is not allowed to initiate an automatic playback.
* Small MP3 player: <code>waitForPlay=yes&autoPlay=no</code>
+
 
 +
==Inserting sounds into questions==
 +
 
 +
See [[Audio in Moodle]]
 +
 
 +
Method to get the Flash player only, and no link to open an external player
 +
 
 +
#In the question text, type "Listen to this sound xxx and say what you heard."
 +
#Select xxx
 +
#Click on the Insert Web Link button
 +
#Give the address of your MP3 file, either a web address or an internal address of a file located in the moodledata directory of your Moodle course.
 +
#Toggle HTML source and view the result, something like this: Listen to <nowiki>< a href="http://moodle/file.php/2/audio/trumpet.mp3" >xxx< /a > </nowiki> and say what you heard.
 +
#Delete xxx
 +
#The result will look something like (2) in screen dump below.
 +
#The student can only use the Flash player.
 +
 
 +
[[Image:Quiz question MP3 example.JPG|thumb|center|Example of Quiz Question with Sound]]
 +
 
 +
==Tips and tricks==
 +
===Temporarily disable the MP3 player ===
 +
* You can surround your link with <nowiki><nolink></nolink></nowiki> tags to stop any kind of processing including the multimedia filters that create the MP3 player. This may be useful when linking to external MP3 files with characters in their name that Flash cannot understand.
 +
:''TIP:''  Be careful with the no link tags or any user written HTML code.  The [[HTML editor]] may eliminate some of your work if you use the HTML editor in the future.  The HTML editor tries to tidy things up for the new user but this can frustrate an experienced user of HTML code.
 +
:''NOTE:'' This does not work for something like the following inserted into a page resource.
 +
<nowiki><nolink><a href="http://theExampleServer.com/file.php/55/mp3_2/mt16/The_file.mp3"> The_file.mp3</a></nolink></nowiki> , however you can stop the multimedia filter from showing when linking to files by adding ?forcedownload=1 to the end of the link.
  
 
==See also==
 
==See also==
 +
* [[Audio in Moodle]] for  links to audio MP3 encoders, audio programs, modules and plugins for Moodle
 +
*[http://moodle.org/mod/forum/discuss.php?d=199218#p869558  Useful forum post regarding mp3s] (with thanks to Guillermo Madero S
 +
 +
  
* Using Moodle [http://moodle.org/mod/forum/discuss.php?d=14663 mp3 player rates] forum discussion
 
* [[Podcasting]]
 
  
 
[[Category:Administrator]]
 
[[Category:Administrator]]
 
[[Category:Teacher]]
 
[[Category:Teacher]]
 
[[Category:Filter]]
 
[[Category:Filter]]
 +
[[Category:Audio]]
 +
 +
[[pl:Odtwarzacz_MP3]]
 +
[[ja:MP3プレイヤー]]

Latest revision as of 20:35, 28 March 2012


The multimedia filter embeds MP3 files in a streaming player made with Flash. The big MP3 player is used when an MP3 file is added as a resource. The small player is used when an MP3 file is linked to from within a forum post or another resource or activity using the HTML editor.

MP3 sample rates

11.025, 22.050 and 44.100 kHz are acceptable sample rates but it is recommended to use only 44.100 kHz (for both, music and speech recordings). The reason is that using a lower sampling rate will have very little effect on the final mp3 file size (bit rates have a bigger impact) but quality will decrease noticeably.

MP3 bit rates

Flash player 9 is no longer limited and can play audio files with the maximum MP3 bit rate, that is 320 kbps. However, while Flash player is not limited anymore, it is recommend to use only one of the following:

-- 96 kbps for speech audio files (if file size is critical, 64 kbps could still be acceptable), as this will avoid having very low quality recordings.

-- 128 kbps for music (but not higher than that, as most people cannot differentiate between a 128 kbps file and a higher one).

It is also recommended to always encode using "Joint stereo" (not "Stereo"), as this will either improve quality or reduce filesize.

Flash security and Cross domain policy

Here are up to date articles on policy file changes in Flash 9 and 10 and on Cross domain policy file usage:


Policy file changes in Flash Player 9 and Flash Player 10

Cross-domain policy file usage recommendations for Flash Player

Cross-domain policy file specification

White paper: Adobe Flash Player 10 security

MP3 Encoder

LAMEs a high quality MPEG Audio Layer III (MP3) encoder licensed under the LGPL.

MP3 player customisation

It is possible to customise the colours of the the MP3 player via CSS included in the theme. For example

.mp3flowplayer_backgroundColor {color: #000000;}

modifies the background colour, see http://flowplayer.org/documentation/skinning/controlbar.html?skin=default for more colour properties, any property that ends with '...Color' can be overridden via CSS.

For accessibility reasons it is not allowed to initiate an automatic playback.

Inserting sounds into questions

See Audio in Moodle

Method to get the Flash player only, and no link to open an external player

  1. In the question text, type "Listen to this sound xxx and say what you heard."
  2. Select xxx
  3. Click on the Insert Web Link button
  4. Give the address of your MP3 file, either a web address or an internal address of a file located in the moodledata directory of your Moodle course.
  5. Toggle HTML source and view the result, something like this: Listen to < a href="http://moodle/file.php/2/audio/trumpet.mp3" >xxx< /a > and say what you heard.
  6. Delete xxx
  7. The result will look something like (2) in screen dump below.
  8. The student can only use the Flash player.
Example of Quiz Question with Sound

Tips and tricks

Temporarily disable the MP3 player

  • You can surround your link with <nolink></nolink> tags to stop any kind of processing including the multimedia filters that create the MP3 player. This may be useful when linking to external MP3 files with characters in their name that Flash cannot understand.
TIP: Be careful with the no link tags or any user written HTML code. The HTML editor may eliminate some of your work if you use the HTML editor in the future. The HTML editor tries to tidy things up for the new user but this can frustrate an experienced user of HTML code.
NOTE: This does not work for something like the following inserted into a page resource.

<nolink><a href="http://theExampleServer.com/file.php/55/mp3_2/mt16/The_file.mp3"> The_file.mp3</a></nolink> , however you can stop the multimedia filter from showing when linking to files by adding ?forcedownload=1 to the end of the link.

See also