Win a copy of Testing JavaScript Applications this week in the HTML Pages with CSS and JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

How to use AudioClips in applet

 
Ranch Hand
Posts: 420
  • 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).]
 
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Have you tried...

?
 
Siegfried Heintze
Ranch Hand
Posts: 420
  • 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: 420
  • 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".
 
Don't get me started about those stupid light bulbs.
    Bookmark Topic Watch Topic
  • New Topic