embed audio files in description

embed audio files in description

by Uwe Twelker -
Number of replies: 25
Hi, I want to provide a simple audio file at the end of the description - to that students can hear the text of the description. Which player do I use (preferably without flash)? Any tutorials around?

I tried a flash player - the same as wordpress is using - but when I want to type the following into the code view:
<p id="audioplayer_1">My Audiofile</p>
 <script type="text/javascript">
 AudioPlayer.embed("audioplayer_1", {
 soundFile: "",
 titles: "call 3 October 09 2009"});
 </script>
</p>

this is all mashed into one line and doesn't work any more.


Thanks a lot
macangelo
Average of ratings: -
In reply to Uwe Twelker

Re: embed audio files in description

by Mary Cooch -
Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Testers Picture of Translators
If you have multimedia filters on in your site admin then you shouldn't need any code. Just type in some blank spaces in the html editor , select those spaces and then click on the link icon. Type in the url of your mp3 file. YOu can upload a file into your Moodle courses from there also. Save and you should get a player automatically then.
In reply to Mary Cooch

Re: embed audio files in description

by Uwe Twelker -
thanks a lot, works great so far - except it opens in a new window. Can I have the player displayed below the text?

Have a great Sunday
macangelo
In reply to Uwe Twelker

Re: embed audio files in description

by Mary Cooch -
Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Testers Picture of Translators
What do you mean it opens in a new window? Is it an mp3 file you are using? The player should "just play" the text , no new window. Do you mean the "description" in the quiz question selection?

In reply to Mary Cooch

Re: embed audio files in description

by Uwe Twelker -
that's exactly what I want. Perhaps I didn't install the multimedia filter correctly. I just copied the folder into mod/data/field/ as the instructions said. Do I have to do anything else?

thanks again
macangelo
In reply to Uwe Twelker

Re: embed audio files in description

by Misty Belmontez -

Try this code:

<embed type="application/x-shockwave-flash" src="http://www.google.com/reader/ui/3247397568-audio-player.swf?audioUrl=http://tw.neisd.net/webpages/mbelmo/files/uploads/210510/clinton.mp3" width="400" height="27" allowscriptaccess="never" quality="best" bgcolor="#ffffff" wmode="window" flashvars="playerMode=embedded" />

I have used it in webpages and Google Earth.

Misty

Average of ratings: Useful (1)
In reply to Misty Belmontez

Re: embed audio files in description

by Uwe Twelker -
Hi Misty. That works fine, thank you. Is it legal to just use it? Do you know?

On the other hand I would rather find a solution without flash because flash is not yet supported by the iPhone.

Have a great Sunday.

macangelo
In reply to Uwe Twelker

Re: embed audio files in description

by Matt Bury -
Picture of Plugin developers
Hi macangelo,

Flash is the de facto platform for audio and video on the web so I suggest keeping that option in for the majority of users. A lot of mobile devices support Flash and iPhone appears to be an exception.

For iPhones, I suggest finding out what audio players they most commonly have installed and using embed code for those, or sometimes just a direct link to the MP3 file will trigger the browser to embed the default MP3 player, although I think this might also trigger Moodle's media filters as described above.

I hope this helps.

Matt
In reply to Matt Bury

Re: embed audio files in description

by Mary Cooch -
Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Testers Picture of Translators
Macangelo - if you go to site admin on your front page>modules>filters then make sure multimedia plugins have the "eye" turned on - and then in multimedia plugins make sure the mp3 is ticked (enabled) -it should be, by default.
In reply to Mary Cooch

Re: embed audio files in description

by Uwe Twelker -
Hi Mary,

this is embarrassing. I mean, I'm new to moodle but not that new. Thank you very much. That was of course the problem.

Is there a way to format the player?

hava a nice evening
macangelo
In reply to Uwe Twelker

Re: embed audio files in description

by Matt Bury -
Picture of Plugin developers
So have Apple finally added Flash Player to their mobile devices? I bet it's only Flash Player lite (AVM1 - AS 2.0). If this is the case, a lot of Flash applications will not run on it so test everything on a few Apple mobile devices before you make any commitments. I believe the ancient MP3 player that Moodle uses will work on FP lite.

I hope this helps smile
In reply to Mary Cooch

Re: embed audio files in description

by Sylvain Roy -

Hi Mary - looks like you might be able to help.  We're trying to embed a small mp3 file right in the front page of our site (that is a small audio prompt). We've created a link in the "Front page description" box within the "Front page settings".  But it does not seem to work.  Any idea?  Thanks!

In reply to Sylvain Roy

Re: embed audio files in description

by Mary Cooch -
Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Testers Picture of Translators
Hi smileIn what way does it not work? Does the player appear but not play? Where is your mp3 file stored? Which browser are you using? Do you have your multimedia filters on as mentioned above? If you can give more detail perhaps we can help more. I'd be happy to take a look but probably we can solve it here with more information.
In reply to Mary Cooch

Re: embed audio files in description

by Sylvain Roy -

Hi and thanks. Actually, it seems like any text I type into the Front page description box does not appear anywhere.  Is there a place where we have to specify that the description should appear?  The mp3 file is stored in the "site files" area.  We did activate the module filters as described previously in this post. Also worth mentioning is that our frontpage is viewable by anonymous visitors not being logged in, and we would like them to hear the small audio clip.

Thanks!

In reply to Sylvain Roy

Re: embed audio files in description

by Mary Cooch -
Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Testers Picture of Translators
Ah - you need either to add a block on the front page called site/course description -then your file will appear, but on the side, or else in front page settings tick the "include a topic section" and then you'll get a section in the centre where you can add text and your mp3 file and it will appear in the middle. This isn't an issue with your mp3 file but in the layout of the front page.
Average of ratings: Useful (1)
In reply to Mary Cooch

Re: embed audio files in description

by Sylvain Roy -
Hi again!  Getting closer - I managed to have the file with the small player appearing in the summary block, the next final step would be to start the player automatically, is that possible?  Thanks much Gros sourire
In reply to Sylvain Roy

Re: embed audio files in description

by Joseph Rézeau -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers Picture of Translators

Hi Sylvain,

I'm not sure it's a good idea to have an audio player start to play automatically when you visit a web page. The visitor's machine audio speaker/headphones might be off. The visitor might be listening to some background music on their system and resent the interruption. Whenever I visit a website which forces audio on me I resent it as an intrusion upon my privacy and run away to some other site.black eye

In my opinion it's enough to display an audio player and let the visitor decide whether they want to click on Play ... or not.

Joseph

In reply to Joseph Rézeau

Re: embed audio files in description

by Sylvain Roy -

Merci Joseph,

Agreed : I discussed the exact same thing with my customer because I feel the same way you do regarding sites that force "music" on me! On the other hand, my customer insisted because the audio "snippet" is 11 seconds long, very easy in terms of audio content and it is somewhat part of the marketing image for the site in development.

I agreed on putting it there on a "trial basis" until he collects enough information on users reaction... and if we cannot start it automatically, we'll just remove it from the front page - I doubt that people would click on a player just to see what happens Indécis.

Now : anyone knows if we can start it automatically?

Syl

In reply to Sylvain Roy

Re: embed audio files in description

by Mary Cooch -
Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Testers Picture of Translators
Hi again Sylvain. I don't know how to make it start automatically but I just want to agree very very much with Joseph (and yourself!) about coming to sites with music playing automatically!
In reply to Sylvain Roy

Re: embed audio files in description

by Joseph Rézeau -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers Picture of Translators
Ok, Sylvain, here we go for your "stubborn client"... There is one way to get all MP3 audio files to play automatically upon entering the page in Moodle. You'll have to edit your current visual theme's config.php file as follows. Be aware that this is a general setting for all of your moodle courses using that modified theme.

change

$THEME->filter_mediaplugin_colors =
'bgColour=000000&btnColour=ffffff&btnBorderColour=cccccc&iconColour=000000&'.
'iconOverColour=00cc00&trackColour=cccccc&handleColour=ffffff&loaderColour=ffffff&'.
'waitForPlay=yes';

to

$THEME->filter_mediaplugin_colors =
'bgColour=000000&btnColour=ffffff&btnBorderColour=cccccc&iconColour=000000&'.
'iconOverColour=00cc00&trackColour=cccccc&handleColour=ffffff&loaderColour=ffffff&'.
'waitForPlay=no&autoPlay=yes';

Average of ratings: Useful (1)
In reply to Joseph Rézeau

Re: embed audio files in description

by Matt Bury -
Picture of Plugin developers
Hi Joseph, I think that solution is a bit extreme and could have undesirable consequences in the rest of the Moodle installation. I guess you're assuming that the client will definitely take good advice and elect to remove the auto play feature ;)

Personally, I'd use a 3rd party MP3 player or at least configure the Moodle MP3 player manually using some embed code. Here's an example that you can edit to meet your needs. It's strict XHTML 1.0, W3C standards compliant-ish (no declarations the the head section). Moodle will most probably mangle it but it should still work:

Get Adobe Flash player

The problem with Moodle's embed method and this one is that it doesn't get around IE's ActiveX issues and some users might experience problems with it. Moodle really should be using SWFObject as its default embed method: http://code.google.com/p/swfobject/

If the default Moodle MP3 player doesn't meet your needs, you may find it easier to use one that I'm developing for Moodle tests: http://code.google.com/p/moodle-mp3-player-for-tests/ If you set the window dimensions to 1x1 pixel, it'll be invisible. I don't know if 0x0 will work but it's also worth a try. Please note that it's Flash Player 9+ and won't work on mobile devices that run Flash Player lite.
Average of ratings: Useful (1)
In reply to Matt Bury

Re: embed audio files in description

by Joseph Rézeau -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers Picture of Translators

Hi Matt,

Of course my solution is extreme and its most undesirable potential consequence is that if there are more than one moodle mp3 players on the same page they will all start playing upon entering the page, which will result in a real cacophony.sad

I do hope forthcoming Moodle 2.0 will have more robust and user-friendly multimedia players, which will work in the most common browsers, and will be finely customizable - not at site level but at least at course level or even better at instance level.

Thanks for the tips and your valuable remarks,

Joseph

In reply to Matt Bury

Re: embed audio files in description

by Joseph Rézeau -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers Picture of Translators

Matt : Here's an example that you can edit to meet your needs. It's strict XHTML 1.0, W3C standards compliant-ish (no declarations the the head section). Moodle will most probably mangle it but it should still work:

What do you mean "here is an example"? All I can see on this forum page is the Get ADobe Flash Player logo, but I have it installed already in FF. I'm puzzled.

Joseph

In reply to Joseph Rézeau

Re: embed audio files in description

by Matt Bury -
Picture of Plugin developers
Hi Joseph,

I tried to post a verbatim code block but I guess this bulletin board interpreted it. How do post verbatim code here?

The get Flash Player button shows up because the embed is unsuccessful. This could be for any number of reasons. Here, it's because the URL to the Flash file is a broken link so your browser shows the alternative content instead. I guess the button is a bit misleading - you can always change the alternative content to something a bit more representative like, "Sorry, this Flash application has not initiated correctly. Please ensure that you have Flash Player 9 or later installed and try again. If this problem persists, please contact your admin." And add the button underneath.

Just from this example, you can see how many problems can arise from not having adequate embed code on a web page. With better embed code, you can display a series of options that tell users and admins exactly what went wrong. If a user doesn't have the necessary minimum version of Flash Player installed, there's also something called expressInstall.swf which is a tiny Flash application which runs on Flash Player 6 or later, and takes users through the update process seamlessly without leaving the site.

Then there's the IE ActiveX issues... sad
In reply to Joseph Rézeau

Re: embed audio files in description

by Sylvain Roy -

Thanks Joseph for the tip,

Implemented it, works OK, now we'll see if we get comments on it.

In reply to Joseph Rézeau

Re: embed audio files in description

by Uwe Twelker -
I strongly agree - imagine someone opens the page in his business environment - sharing his office …