×

Discussion Board

Results 1 to 9 of 9

Thread: Playing sound?

  1. #1
    Regular Contributor
    Join Date
    Apr 2009
    Posts
    54

    Playing sound?

    How can I play sounds by the press of a button in a WRT-widget?

    I'm trying to use:

    Code:
    <object id="sound1" type="audio/x-mpeg" data="mysound.mp3" width="18" height="20" autoplay="true" autostart="0"></object>
    But despite setting autoplay to false and autostart to 0, the last sound is automatically played when the widget is loades. Any ideas/suggestions?

  2. #2
    Regular Contributor
    Join Date
    Apr 2003
    Location
    Akron Ohio USA
    Posts
    229

    Re: Playing sound?

    I had the same experience with embedded sound.

    You might try using Flash if you need the interface within the screen.

    Alternatively you can use openURL to load the sound into the music player.

  3. #3
    Registered User
    Join Date
    Sep 2008
    Location
    Manaus, Brazil
    Posts
    109

    Re: Playing sound?

    Instead of use openURL or use flash embedd, you can open the Music Player Application. Look here: how you do this: http://library.forum.nokia.com/topic...F8DB2DDC8.html
    Javier Zambrano Ferreira

  4. #4
    Regular Contributor
    Join Date
    Apr 2003
    Location
    Akron Ohio USA
    Posts
    229

    Re: Playing sound?

    can you pass a url to the music player through openApplication? I've tried this in the past and was only able to open the music player, but not specify a sound file or url.

    perhaps you can include a code example of how to use openApplication to play an online sound or a sound stored in the file system.

  5. #5
    Regular Contributor
    Join Date
    Apr 2009
    Posts
    54

    Re: Playing sound?

    hp3:

    Quote Originally Posted by hp3 View Post
    I had the same experience with embedded sound.

    You might try using Flash if you need the interface within the screen.

    Alternatively you can use openURL to load the sound into the music player.
    I need to integrate a copule of sounds in a single page, and the user should be able to press a button to listen to a sound without leaving the page, preferrably.
    With this background, is Flash the best method? And do you mean embedding a flash-object (swf-file containing a sound) with:

    Code:
    <EMBED src=”mysound.swf" wmode=”transparent” … (other parameters)> </EMBED>
    Additionally (assuming this works), does all the nokia telephones able to manage widgets play flash without having to first install it?


    Javier:

    Thanks for the tip, but that would mean exiting or at least pushing the widget to the back, right? That would make it very tedious since there are several sounds that are short and should play by the press of a button. It would be a lot of flipping between applications.
    Last edited by Danneman; 2009-07-29 at 01:56.

  6. #6
    Regular Contributor
    Join Date
    Apr 2003
    Location
    Akron Ohio USA
    Posts
    229

    Re: Playing sound?

    yes, this requires launching the music player on top of the widget. I've also encountered intermitent problems with s60 3.2 devices when going back and forth between the music player and widget, where the widget no longer changes the label and function of the right softkey when the user turns the device into landscape mode.

    It would be much better if Nokia came up with a real HTML 5 solution for audio within its web browser intead of the poorly implemented audio video option we have now.

  7. #7
    Regular Contributor
    Join Date
    Apr 2009
    Posts
    54

    Re: Playing sound?

    This code works:

    Code:
    <object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="125" height="125" id="MyFlash" align="top">
    	<param name="allowScriptAccess" value="sameDomain" />
    	<param name="movie" value="test.swf" />
    	<param name="loop" value="false" />
    	<param name="menu" value="false" />
    	<param name="quality" value="high" />
    	<param name="wmode" value="opaque" />
    	<param name="bgcolor" value="#ffffff" />
    	<embed src="test.swf" loop="true" menu="false" quality="high" wmode="opaque" bgcolor="#ffffff" width="25" height="25" name="Finish" align="top" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />
    </object>
    The only problem Im left with is that I have to hoover over the flash-button in order to make it visible.

    Perhaps this has to do with the fact that Im using a technique to load partial code of html into the index.html so as to have several pages in a widget. It seems the page doesnt refresh properly doing this. Ive tried <meta http-equiv="refresh" content="600">, but that doesnt help. Is there any way to fix this?

  8. #8
    Regular Contributor
    Join Date
    Apr 2003
    Location
    Akron Ohio USA
    Posts
    229

    Re: Playing sound?

    another way to do this is to use a hidden flash player and javascript interaction with the flash player to play the sound. Use HTML and javascript for the interface instead of flash. This way you may not need to deal with giving focus to the flash player first before being able to operate the embedded flash player.

    There is a wiki post about using javascript with flash.

  9. #9
    Regular Contributor
    Join Date
    Apr 2009
    Posts
    54

    Re: Playing sound?

    Quote Originally Posted by hp3 View Post
    another way to do this is to use a hidden flash player and javascript interaction with the flash player to play the sound. Use HTML and javascript for the interface instead of flash. This way you may not need to deal with giving focus to the flash player first before being able to operate the embedded flash player.

    There is a wiki post about using javascript with flash.
    I think I found the post (http://wiki.forum.nokia.com/index.ph...dget_%28WRT%29), and it seems like a good idea. However, Ive just converted all my code using embedded flash and it works alright, so Ill postpone it for a while.

    Thanks for the help guys

Similar Threads

  1. Replies: 3
    Last Post: 2008-08-03, 09:04
  2. Sound recording and playing
    By sasa in forum Symbian
    Replies: 0
    Last Post: 2004-10-12, 13:41
  3. Problem on playing sound in emulator
    By mhahn0106 in forum Symbian Tools & SDKs
    Replies: 0
    Last Post: 2004-01-12, 06:00
  4. strange problem playing Sound on 7650
    By Poldipold in forum Mobile Java Media (Graphics & Sounds)
    Replies: 1
    Last Post: 2003-07-11, 13:12
  5. Playing wav sound with the nokia api
    By yuvalgeva in forum Mobile Java General
    Replies: 0
    Last Post: 2002-12-18, 12:50

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •