MP3プレイヤー

提供:MoodleDocs
2009年3月24日 (火) 15:15時点におけるMitsuhiro Yoshida (トーク | 投稿記録)による版
移動先:案内検索

作成中です - Mitsuhiro Yoshida 2009年3月16日 (月) 19:39 (UTC)

マルチメディアフィルタでは、Flashで作成されたストリーミングプレイヤーにMP3ファイルを埋め込みます。大きなMP3プレイヤーは、MP3ファイルのリソース追加時に使用されます。例) Moodle機能デモ: MP3ファイル。小さなプレイヤーは、HTMLエディタを使用して、フォーラム投稿、その他のリソース、活動にMP3ファイルがリンクされた場合に使用されます。

MP3プレイヤーレート

MP3が正しいレートで再生されるかどうか確認してください。11、22または44kHZのサンプルレートを使ってください。可変ビットレート (Variable Bit Rate (VBR)) ファイルよりも、固定ビットレート (Constant Bit Rate (CBR)) ファイルを推奨します。サンプルおよびビットレートは同じでありませんので留意してください。下記のMP3サンプルレートおよびMP3ビットレートをご覧ください。

MP3サンプルレート

MP3ファイルが11.025 kHzの倍数のサンプルレートにエンコードされていない場合、Flash Playerは好ましくない結果を引き起こしてしまいます。言い換えれば、受け入れられるサンプルレートは以下のようになります:

  • 11.025 kHz
  • 22.050 kHz
  • 44.100 kHz

MP3ビットレート

大部分のMP3エンコーダでデフォルトビットレートとなっている、128kbpsより高いビットレートのMP3ファイルは、Flash Playerで再生することができません。ウェブで使用するため、ダウンロードが速く、より少ないサーバディスクスペースを使用する、少ないビットレートをお勧めします。あなたが受け入れることのできるサウンドクオリティを持った小さなサイズのファイルを得るため、異なるビットレートで実験してみてください。一般的なビットレートは次のとおりです:

  • 32 kbps, mono - スピーチのみ
  • 40 kbps, mono - 音楽はOKだと思います。
  • 40 kbps, stereo - スピーチのみ
  • 48 kbps, mono - いくつかの音楽ではOKです。
  • 48 kbps, stereo - スピーチのみ
  • 56 kbps, stereo - いくつかの音楽ではOKです。
  • 64 kbps, stereo - いくつかの音楽ではOKです。

Flashセキュリティ設定

Flash Player7でのセキュリティに関する変更により、リモートサーバ内にあるMP3ファイルをMP3プレイヤーで再生できなくなりました。この問題は、リモートサーバにクロスドメインポリシーを記述すること、それぞれのユーザがFlash Playerの設定マネージャでグローバルセキュリティ設定を変更することで解決することができます。

Cross-domain policy

To create a cross-domain policy, save the code below as crossdomain.xml and place the file at the root of the remote server.

<cross-domain-policy>
   <allow-access-from domain="www.yourmoodlesite.org" />
</cross-domain-policy>

Please refer to Macromedia - Developer Center: Security Changes in Macromedia Flash Player 7 for further details.

Global security settings

Please refer to Macromedia - Flash Player Help: Global Privacy Settings Panel.

MP3 player colours

theme/yourtheme/config.php contains options for changing the default colours (black, white and grey) of the MP3 player.

$THEME->resource_mp3player_colors = 
 '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 = 
 '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

theme/yourtheme/config.php contains options for changing the playback options of the MP3 player.

  • waitForPlay determines whether the MP3 file starts downloading as soon as the player appears on the page (waitForPlay=no), or whether the play button must be pressed before the MP3 file starts downloading (waitForPlay=yes).
  • autoPlay determines whether the MP3 player starts playing the MP3 as soon as the player appears on the page (autoPlay=yes), or whether it must be fully downloaded before playing (autoPlay=no).
  • buffer determines how many seconds of the MP3 file must be downloaded before the MP3 starts playing e.g. 10 seconds (buffer=10).

Default playback options

  • Big MP3 player: buffer=10&waitForPlay=no&autoPlay=yes
  • Small MP3 player: waitForPlay=yes&autoPlay=no

Inserting sounds into questions

In a forum, Joseph Rezeau offer this

There are various ways to insert links to media files in Moodle. You can

  • (1) insert a link which when clicked will open a new window activating your computer's default media player (e.g. quicktime, realaudio, windows media player, etc.)
  • (2) OR rely on the automatic insertion of the small Flash player built-in Moodle
  • (3) OR both!

The Filter for multimedia must be on and Flash enabled. The HTML editor needs to be active for the question content.

  1. In the question text, type "Listen to this sound and select your answer."
  2. Select by highlighting "this sound"
  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" >this sound< /a > and say what you heard. (See NOTE about filenaming below!)
  6. Now type in the rest of your question data, depending on its type (MCQ, short answer, etc.).
  7. The result will look something like (3) in screen dump below.
  8. The student has a choice of using the Flash player (with its minimum buttons) or clicking on the link, which will open the computer's default media player, with all its buttons.
Note: Unfortunately it would be best to give filenames to the
sounds that do NOT contain the information you are asking about.
There are several ways the page viewer can see that name and see
"Aha, it's a trumpet!"

(2) 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 web page resource. (Add a resource > Compose a web page)

<nolink><a href="http://theExampleServer.com/file.php/55/mp3_2/mt16/The_file.mp3"> The_file.mp3</a></nolink>

関連情報