Melodeon.net Forums

Discussions => General Discussion => Topic started by: rees on February 26, 2013, 02:00:50 PM

Title: Major scientific breakthrough in Wales!
Post by: rees on February 26, 2013, 02:00:50 PM
I've somehow managed to chisel a music player into the code on my website (courtesy of Harriet Bartlett - cheers H;-)  )
There is now funky sound sample of one of the instruments (big button, says LISTEN, can't miss it) embedded therein.

While it all works from this end, I'm not sure if it's actually "out there"

Have a listen and let me know: www.melodeons.com (http://www.melodeons.com)

PS: If anyone knows how I can get it to stay on the main page while the music is playing, I'd be most grateful for your help.
Title: Re: Major scientific breakthrough in Wales!
Post by: Lester on February 26, 2013, 02:11:44 PM
You have electricity in Wales  ;)
Title: Re: Major scientific breakthrough in Wales!
Post by: rees on February 26, 2013, 02:15:46 PM
don't start!
Title: Re: Major scientific breakthrough in Wales!
Post by: Adam-T on February 26, 2013, 02:20:35 PM
You have electricity in Wales  ;)

You don`t think they clip the sheep by hand do you ?  ;D
Title: Re: Major scientific breakthrough in Wales!
Post by: Rob2Hook on February 26, 2013, 02:21:23 PM
Works even for a Luddite like me!

Rob
Title: Re: Major scientific breakthrough in Wales!
Post by: Andy Simpson on February 26, 2013, 02:27:33 PM
Works for me, opens in iTunes...
Title: Re: Major scientific breakthrough in Wales!
Post by: Andrew Wigglesworth on February 26, 2013, 02:37:23 PM
Technically that's a simple link to an audio file, not embedding. That's why it doesn't play "on the page". How the audio file is dealt with is dependent upon the settings on the web browser.

eg. of the different web browsers I use, when I click on the link:

- one plays the file itself, not giving any other options.
- one gives a series of options including playing or saving the file.
- one downloads the file, shows the binary code and then offers to save it.

The simplest way to embed audio so that it plays on the page rather than simply linking to a file is to use HTML 5 audio tags.

Code: [Select]
<audio controls>
  <source src="my_audio_file.ogg" type="audio/ogg">
  <source src="my_audio_file.mp3" type="audio/mpeg">
</audio>

The reason that you should offer it in both Ogg Vorbis and mp3 formats is the Microsoft does not support Vorbis and because of licensing issues Firefox does not support mp3.

If that fails (ie. the web browser does not support the audio tag), it will do it silently in the browser. It's  best then to offer an alternative for those browsers.

Code: [Select]
<audio controls>
  <source src="my_audio_file.ogg" type="audio/ogg">
  <source src="my_audio_file.mp3" type="audio/mpeg">
<a href="my_audio_file.ogg">Listen here</a>
</audio>

You could offer the mp3 file instead if you insist  :P

If you use Audacity then Ogg Vorbis is one of the output options when exporting a file. It should be an option in other programmes, but I don't know much about those that only run on Windows or OSX.

NB. Someone is bound to pick up on the fact that you probably ought not to do this on an HTML 4 coded page, it's not syntactically correct. However, this particular situation is a rare one in which I wouldn't worry too much about that, and it will work. Ideally you would change the page over to HTML 5 of course.

That OK Anahata?   ;D

edited: for spelling 
Title: Re: Major scientific breakthrough in Wales!
Post by: Andrew Wigglesworth on February 26, 2013, 02:45:03 PM
Rees, you can PM/Email me if you want any other practical help ... no obligations  8)
Title: Re: Major scientific breakthrough in Wales!
Post by: rees on February 26, 2013, 04:07:33 PM
Thanks Andrew.
Title: Re: Major scientific breakthrough in Wales!
Post by: baz parkes on February 26, 2013, 04:52:01 PM
What Andrew said...honest.... >:E
Title: Re: Major scientific breakthrough in Wales!
Post by: Stiamh on February 26, 2013, 04:59:44 PM
Thanks for the tutorial Andrew... time to update my own websites!

I have been using Goldwave for Windows for yonks. It's not free but I don't think Audacity was around at the time I bought it. It does .ogg.

I remember childhood holidays at my uncle's little dairy farm in Cardiganshire. No electricity - cows milked by hand. Gas lights. I think they had a telephone...
Title: Re: Major scientific breakthrough in Wales!
Post by: rees on February 26, 2013, 05:31:03 PM
Thanks for the tutorial Andrew... time to update my own websites!

I have been using Goldwave for Windows for yonks. It's not free but I don't think Audacity was around at the time I bought it. It does .ogg.

I remember childhood holidays at my uncle's little dairy farm in Cardiganshire. No electricity - cows milked by hand. Gas lights. I think they had a telephone...

We lived in a place like that in Cardiganshire. We did have a phone but it was a party line. Ee, takes me back.

Baz, are you sure?
Title: Re: Major scientific breakthrough in Wales!
Post by: Chris Ryall on February 26, 2013, 06:41:39 PM
The sound clips on http://chrisryall.net/modes/ are about as "built in" as you can get on an HTML4 page, and are a dog's breakfast. Problem is that all the browsers do their own thing, Apple with quite vainglorious independence of mind.

A standard for HTML5 is now stable but won't be a standard until 2015 or so.  I'm trying to use it for the demo sound on Melodeon Explorer, and it is "just markup"  :D but this puts you completely at the mercy of the user's browser. I think Clive is using something clever in Java  for his app project.

Most browsers now have an HTML5, experimental implementation, and this includes video. Problems are that you need both .ogg and .mp3 versions of your sound to cover the pack. Microsoft are particularly awkward and buggy

Have a look at the code for my modes page; you can then autoplay using a parameter. YouTube is another way to do it. Press the share button and take the Embed option. This method even works on Apple kit.  Good luck
Title: Re: Major scientific breakthrough in Wales!
Post by: Andrew Wigglesworth on February 26, 2013, 08:38:19 PM
The sound clips on http://chrisryall.net/modes/ are about as "built in" as you can get on an HTML4 page, and are a dog's breakfast. Problem is that all the browsers do their own thing, Apple with quite vainglorious independence of mind.

A standard for HTML5 is now stable but won't be a standard until 2015 or so.  I'm trying to use it for the demo sound on Melodeon Explorer, and it is "just markup"  :D but this puts you completely at the mercy of the user's browser. I think Clive is using something clever in Java  for his app project.

Most browsers now have an HTML5, experimental implementation, and this includes video. Problems are that you need both .ogg and .mp3 versions of your sound to cover the pack. Microsoft are particularly awkward and buggy

Have a look at the code for my modes page; you can then autoplay using a parameter. YouTube is another way to do it. Press the share button and take the Embed option. This method even works on Apple kit.  Good luck

Audio on a webpage should be simple to implement. HTML 5 right now is our best hope and in reality far and away the best implementation method right now. All you need is a browser and every graphical web browser I can think of supports it, and that won't be changing.

No need for Java (which Java implementation do you use? Not everyone has Java plugins/runtime installed), no need for Javascript (copy and paste Javascript? Can you really de-bug it when it all goes wrong in certain browsers?), Adobe Flash (proprietary and privacy busting, not included/allowed by certain companies, fast being left behind by other solutions. Adobe Flash is no longer developed for many platforms including mobile ones).

The reason that Microsoft and Apple refuse to support open (free software) audio and video formats (such as Ogg Vorbis, Theora and Webm) is because they hate them, nothing more or less. They could easily implement them, freely and without restrictions to them, but they don't because they don't fit into their world view.
Title: Re: Major scientific breakthrough in Wales!
Post by: Hasse on February 26, 2013, 09:17:52 PM
I some how thought this was all about Swansea and Michael Laudrup, But this is just as intresting, thanks Andrew!

One little trick to cheat your way round HTML coding problems is to use Firebug  (https://getfirebug.com/)and borrow from sites you like or just to fast see how they get around a certain problem, (and then use and redo the coding to fit the site your working on, sometimes an easy and fast way of solving a problem.
Title: Re: Major scientific breakthrough in Wales!
Post by: Chris Ryall on February 26, 2013, 09:58:17 PM

  Been there too  ;)
Title: Re: Major scientific breakthrough in Wales!
Post by: Nick Collis Bird on February 27, 2013, 06:19:39 AM
You have electricity in Wales  ;)

You don`t think they clip the sheep by hand do you ?  ;D

It's the Wellington boots that worry me.
Title: Re: Major scientific breakthrough in Wales!
Post by: OldJack on February 27, 2013, 07:10:35 AM
I've somehow managed to chisel a music player into the code on my website (courtesy of Harriet Bartlett - cheers H;-)  )
There is now funky sound sample of one of the instruments (big button, says LISTEN, can't miss it) embedded therein.

While it all works from this end, I'm not sure if it's actually "out there"

Have a listen and let me know: www.melodeons.com (http://www.melodeons.com)

PS: If anyone knows how I can get it to stay on the main page while the music is playing, I'd be most grateful for your help.


I found it at the very bottom. Sort of expected it to be at the beginning. I like the sound. Nice job -- I think.
Title: Re: Major scientific breakthrough in Wales!
Post by: Steve_freereeder on February 27, 2013, 07:13:48 AM
The simplest way to embed audio so that it plays on the page rather than simply linking to a file is to use HTML 5 audio tags.

Code: [Select]
<audio controls>
  <source src="my_audio_file.ogg" type="audio/ogg">
  <source src="my_audio_file.mp3" type="audio/mpeg">
</audio>

The reason that you should offer it in both Ogg Vorbis and mp3 formats is the Microsoft does not support Vorbis and because of licensing issues Firefox does not support mp3.
Andrew,
I'm interested in what you say about Firefox and mp3 format; I don't think I have a problem using Firefox. I run the Lizzie Dripping (http://www.lizziedripping.org.uk) website which includes links to audio samples from the website music page (http://www.lizziedripping.org.uk/music.html). These are in mp3 format and play perfectly fine in the web browsers I have tested: Firefox, Safari, IE, Netscape (remember that one?). I've only ever uploaded mp3 files to the hosting server, not .ogg files.
Title: Re: Major scientific breakthrough in Wales!
Post by: baz parkes on February 27, 2013, 10:54:05 AM


Baz, are you sure?

Of course...trust me...I plug the minotaurs in....
Title: Re: Major scientific breakthrough in Wales!
Post by: Andrew Wigglesworth on February 27, 2013, 11:42:40 AM
The simplest way to embed audio so that it plays on the page rather than simply linking to a file is to use HTML 5 audio tags.

Code: [Select]
<audio controls>
  <source src="my_audio_file.ogg" type="audio/ogg">
  <source src="my_audio_file.mp3" type="audio/mpeg">
</audio>

The reason that you should offer it in both Ogg Vorbis and mp3 formats is the Microsoft does not support Vorbis and because of licensing issues Firefox does not support mp3.
Andrew,
I'm interested in what you say about Firefox and mp3 format; I don't think I have a problem using Firefox. I run the Lizzie Dripping (http://www.lizziedripping.org.uk) website which includes links to audio samples from the website music page (http://www.lizziedripping.org.uk/music.html). These are in mp3 format and play perfectly fine in the web browsers I have tested: Firefox, Safari, IE, Netscape (remember that one?). I've only ever uploaded mp3 files to the hosting server, not .ogg files.


OK, a quickie (if I can manage that :D ) since I'm off out in a short while.

On your website you are using Javascript and object/embed tags to embed a media player plugin into the web page.

For instance, on the computer I'm using now it pulls in a plugin that launches the "Gecko Media Player" that uses Mplayer to play the audio. It is Mplayer (or whatever audio player is called by the plugin on other computers) that is playing the audio *not* the web browser.

When using HTML 5, no plugins or external programmes are used. It is the web browser itself that is playing the audio file. Since the embedding code is far simpler and the results much more predictable it is a far better way of embedding audio on a web page.

A few other comments ... see, I can't help myself  ::)

People have come up with all sorts convoluted and "clever" ways of embedding audio (and video) onto web pages. Sadly, for many people these "clever" ways fail, are discriminatory or are disruptive to their computer.

Object/embed tags and Javascript pulling in media plugins has been one way, but this is very hit and miss. It assumes that the web browser is interpreting Javascript (or is even capable of interpreting it) and has media plugins (or is even capable of using media plugins).

It's a complicated system with many points of failure, not least of which is the capacity to crash the web browser. For instance, the Lizzie Dripping audio player pages crash the browser on my laptop ... "pop" and it's gone.

If the web browser is not interpreting Javascript or it does not have a media plugin, then the player on the Lizzie Dripping website simply fails, silently. There is no explanation and no access to the audio files. Even when it successfully plays the file there is very little predictability over what actually happens. Here it downloads the whole file and simply starts playing it with no controls to pause, stop or restart it.

If using Javascript then a noscript tag should be used to offer the information (the audio file in this case) to browsers not running Javascript. A descriptive alternative in text should be used with object tags so that if the web browser does not support the plugin (or applet) then the user can still access the content.

I used the word "discriminatory", not to be pejorative, it's simply a description of one of the real consequences of web accessibility failures. Blind and partially-sighted users (for instance) do not access websites in the same way that that fully-sighted people do. They often do not use the same web browsers, use screen readers or if they use the same browsers, they do not have them set up in the same way.

This was meant to be a few quick comments so I'm going to heavily edit myself here ... basically, if you are using "clever" ways of presenting information or media files then there should be alternatives for people who cannot use these ways.

Steve, please don't take my comments in the wrong way. I'm not commenting upon anyones character or implying bad intentions. Sadly, with all the competing interests and, quite frankly, the anti-social behaviour of many companies this whole area can be a minefield. Some of us deal with these issues daily, so we know a bit more about what is going on, that's all.  (:)

edited: spelling
Title: Re: Major scientific breakthrough in Wales!
Post by: Andrew Wigglesworth on February 27, 2013, 11:51:08 AM
Oh, I should have said, really nice tunes and playing on the Lizzie Dripping site.

Thanks for that, I enjoyed it.
Title: Re: Major scientific breakthrough in Wales!
Post by: Chris Ryall on February 27, 2013, 11:59:43 AM
Having put some thought and much experimentation into this in December when voicing ME .. All of what Andrew says. This was a complete mess made worse by Apple and Microsoft trying to maintain a proprietary edge in what should be a simple  "standard"

HTML5 <audio> tags are not 100% ready, but are the clear way forward, and what I've installed. You need .ogg and .mp3 versions of your clips, easy with Audacity.

I'd say 95% of browsers will display and play something sensible already. If they don't my advice is that it be left as a non compliance problem for them rather than tax yourself with any workaround.

A line suggesting "up to date browser version" to enjoy the music makes much sense. As the <audio> tag is intended as universal that will make bugs self fixing.   HTML5 will solve so many other diddly issues that I think all will have to fall in line over the coming year. :|glug
Title: Re: Major scientific breakthrough in Wales!
Post by: Steve_freereeder on February 28, 2013, 01:37:12 AM
Thanks Andrew and Chris both for your replies. I have very little technical knowledge when it comes to html coding. I can do the basics, but mostly I just use 'Freeway' software to create the coding as if I were using a word processor. However, I have learned a bit more as a result of this exchange, thank you.  (:) 

Steve, please don't take my comments in the wrong way. I'm not commenting upon anyones character or implying bad intentions. Sadly, with all the competing interests and, quite frankly, the anti-social behaviour of many companies this whole area can be a minefield. Some of us deal with these issues daily, so we know a bit more about what is going on, that's all.  (:)
Of course not - don't worry, your post did not come over in a bad light at all. On the contrary, it was most informative, thanks.

Oh, I should have said, really nice tunes and playing on the Lizzie Dripping site.

Thanks for that, I enjoyed it.
Thanks! I passed on your comment to my fellow musician Celia at our Lizzie Drips practice earlier this evening. (:)
SimplePortal 2.3.5 © 2008-2012, SimplePortal