Problem with sound

103 views
Skip to first unread message

bryanb

unread,
Apr 5, 2012, 5:14:19 AM4/5/12
to gwt-voices
Hi,

Using gwt-voices-2.1.8 and GWT 2.4.0. I have 2 problems.

1.
I've created a resource:

@Source("sounds/ringin.wav")
DataResource bell();

then use it as:

String s = Resources.INSTANCE.bell().getSafeUri().asString();
SoundController soundController = new SoundController();
Sound sound =
soundController.createSound(Sound.MIME_TYPE_AUDIO_WAV_UNKNOWN, s); //
plays sound ??
sound.play(); // plays sound OK

When I call SoundController.createSound() the sound plays, which I
suspect it should not. Using Sound.play() works as it should. Is there
a way to stop the sound being played when it is first loaded ?

2.
If I don't use a resource,

String s = GWT.getHostPageBaseURL() + "sounds/ringin.wav";
SoundController soundController = new SoundController();
Sound sound =
soundController.createSound(Sound.MIME_TYPE_AUDIO_WAV_UNKNOWN, s); //
no sound
sound.play(); // no sound

If I type the URL returned by GWT.getHostPageBaseURL() + "sounds/
ringin.wav" into the browser, the sound plays, so I know the file
location is correct.

Any ideas why this doesn't work.

Thanks.

Fred Sauer

unread,
Apr 9, 2012, 5:43:38 PM4/9/12
to gwt-v...@googlegroups.com
Your resource may be turned into a data: URI, which browsers may not playback. Try adding the @DoNotEmbed to the resource.


--
You received this message because you are subscribed to the Google Groups "gwt-voices" group.
To post to this group, send email to gwt-v...@googlegroups.com.
To unsubscribe from this group, send email to gwt-voices+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/gwt-voices?hl=en.




--
Fred Sauer
fr...@allen-sauer.com
Reply all
Reply to author
Forward
0 new messages