[Sugar-devel] Sugar Web Activity Sound

Lionel Laské lionel at olpc-france.org
Tue Jun 24 07:19:58 EDT 2014


Hi Kevin,

I wrote three Sugar Web activities using HTML 5 Audio (FoodChain,
Abecedarium, TankOp), you could have a look on the source code to see how
I've managed the sound.

Basically, I'm relying on <audio> HTML5 tag. BTW my personal experience
tell me that only ONE HTML5 tag should be present in the application to
avoid problem. So, I've decided to put an instance in the top level page an
reused it along the app. See [1][2][3] for more.

Hope it could help.

Best regards from France.

           Lionel

[1] https://github.com/llaske/TankOp.activity/blob/master/audio.js#L5
[2] https://github.com/llaske/TankOp.activity/blob/master/index.html#L29
[3] https://github.com/llaske/TankOp.activity/blob/master/js/activity.js#L19


2014-06-23 18:00 GMT+02:00 <sugar-devel-request at lists.sugarlabs.org>:

> Send Sugar-devel mailing list submissions to
>         sugar-devel at lists.sugarlabs.org
>
> To subscribe or unsubscribe via the World Wide Web, visit
>         http://lists.sugarlabs.org/listinfo/sugar-devel
> or, via email, send a message with subject or body 'help' to
>         sugar-devel-request at lists.sugarlabs.org
>
> You can reach the person managing the list at
>         sugar-devel-owner at lists.sugarlabs.org
>
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of Sugar-devel digest..."
>
>
> Today's Topics:
>
>    1. Sugar Web Activity Sound (Kevin Kreuzer)
>    2. Re: Sugar Web Activity Sound (Sam Parkinson)
>
>
> ----------------------------------------------------------------------
>
> Message: 1
> Date: Mon, 23 Jun 2014 11:52:58 +0200
> From: Kevin Kreuzer <kevin.kreuzer90 at icloud.com>
> To: sugar-devel at lists.sugarlabs.org
> Subject: [Sugar-devel] Sugar Web Activity Sound
> Message-ID: <6E451046-C802-4B8E-8034-142B74C93979 at icloud.com>
> Content-Type: text/plain; charset=windows-1252
>
> Hello
>
> I am developing a Sugar Web Activity.
> I have installed osbuild on an Linux Fedora to have a full Sugar
> environment.
>
> In my application I want to include sounds. If I visit a website with the
> browser in Sugar I am able to play sounds. I have already written the code
> for the sound.
> This code looks like this:
>
> var backgroundmusic = new Audio("");
> document.body.appendChild(backgroundmusic);
> backgroundmusic.src = ?blabla.ogg"
> backgroundmusic.play();
>
> Everything works perfectly fine if I start my application with Sugarizer
> in a Web Browser by double clicking on the index.html.
> But if I run my application on Sugar it doesn?t work. If have tried now
> for a few days and I am always getting the same result.
>
> Am I missing any configuration or is there something wrong with my
> installation?
>
> Thanks for the help
>
> ------------------------------
>
> Message: 2
> Date: Mon, 23 Jun 2014 20:15:53 +1000
> From: Sam Parkinson <sam.parkinson3 at gmail.com>
> To: Kevin Kreuzer <kevin.kreuzer90 at icloud.com>
> Cc: Sugar-dev Devel <sugar-devel at lists.sugarlabs.org>
> Subject: Re: [Sugar-devel] Sugar Web Activity Sound
> Message-ID:
>         <
> CACVKbrWCy+T07MhWHwpixfJu30xwKeghum007WVSz+3SOxpw2g at mail.gmail.com>
> Content-Type: text/plain; charset="utf-8"
>
> Hi Kevin,
>
> Are you sure the api your using is compatible with gtkwebkit2 (the web
> engine sugar uses)?
>
> Try installing 'epiphany' (aka. Web) outside osbuild.  Epiphany also uses
> gtkwebkit2 - so if it works in Epiphany it is a bug is sugar or osbuild.
> (I wouldn't be surprised if it doesn't work - gtkwebkit2 is not as good as
> firefox or chrome)
>
> Sam
> On Jun 23, 2014 7:53 PM, "Kevin Kreuzer" <kevin.kreuzer90 at icloud.com>
> wrote:
>
> > Hello
> >
> > I am developing a Sugar Web Activity.
> > I have installed osbuild on an Linux Fedora to have a full Sugar
> > environment.
> >
> > In my application I want to include sounds. If I visit a website with the
> > browser in Sugar I am able to play sounds. I have already written the
> code
> > for the sound.
> > This code looks like this:
> >
> > var backgroundmusic = new Audio("");
> > document.body.appendChild(backgroundmusic);
> > backgroundmusic.src = ?blabla.ogg"
> > backgroundmusic.play();
> >
> > Everything works perfectly fine if I start my application with Sugarizer
> > in a Web Browser by double clicking on the index.html.
> > But if I run my application on Sugar it doesn?t work. If have tried now
> > for a few days and I am always getting the same result.
> >
> > Am I missing any configuration or is there something wrong with my
> > installation?
> >
> > Thanks for the help
> > _______________________________________________
> > Sugar-devel mailing list
> > Sugar-devel at lists.sugarlabs.org
> > http://lists.sugarlabs.org/listinfo/sugar-devel
> >
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL: <
> http://lists.sugarlabs.org/archive/sugar-devel/attachments/20140623/17609414/attachment-0001.html
> >
>
> ------------------------------
>
> _______________________________________________
> Sugar-devel mailing list
> Sugar-devel at lists.sugarlabs.org
> http://lists.sugarlabs.org/listinfo/sugar-devel
>
>
> End of Sugar-devel Digest, Vol 68, Issue 45
> *******************************************
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.sugarlabs.org/archive/sugar-devel/attachments/20140624/e37a2835/attachment.html>


More information about the Sugar-devel mailing list