• Post Reply Bookmark Topic Watch Topic
  • New Topic

How to use AudioClips in applet

 
Siegfried Heintze
Ranch Hand
Posts: 417
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I can make the audio clip feature work from the appletviewer.exe when I call getAudioClip(new URL("file:./Dogbrk.wav"));
However, now I want to put it on a public web site and this code does not work.
<code> audioClipName = getParameter("AudioClip");
if(audioClipName != null)
//try{
// audioClip = getAudioClip(new URL(audioClipName)); // worked in applet viewer, not in browser
audioClip = getAudioClip(getCodeBase(), audioClipName);
//}catch(java.net.MalformedURLException e){System.out.println("java.net.MalformedURLException="+e);}
}</code>
Here is my HTML
<code><pre>< applet code="QuestionAnswer.class" height="18" width="160" codebase="./">
< param name="Question" value="CPU Vendor Indpendence?">
< param name="Answer" value="NO!">
< param name="AudioClip" value="Dogbrk.wav">
< /applet>
</pre></code>

[This message has been edited by Jim Yingst (edited August 18, 2000).]
 
TransZamboni
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Have you tried...

?
 
Siegfried Heintze
Ranch Hand
Posts: 417
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by TransZamboni:
[B]Have you tried...

?[/B]

Yes, that does not work either. I went to www.wrox.com
and downloaded the sample applet from Ivor Horton's book to play sounds.It works fine locally, not when I up load it to my web.
 
Siegfried Heintze
Ranch Hand
Posts: 417
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
More info: Netscape shows "76% of 13K bytes, 1 second remaining" when I call the play(getCodeBase(),"Dogbrk.wav") file. Then a little later it comes back and says "stalled".
 
Paper has not yet been outlawed – so let your Java Swing application print with wild abandon: JPDF
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!