MLUG: Re: [MLUG] Java Sound Problem
Re: [MLUG] Java Sound Problem
Email address obfuscation in effect -- please click here to turn it off.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Have you looked perhaps at the console logs?  Most browsers will let 
you see the java output to check for any errors.  Chances are it's the 
file://file.wav issue.  If you're running this as an applet, it may 
also be related to the security and what a applet will let you run.  
Keep in mind an applet is running on the client machine, NOT the 
server, and as such, it has a great many restrictions on what it's 
allowed to open and do.  Further, the URL references the local 
filesystem, not a remote file system, and as such, file.wav would 
reference something on your harddrive.  There's the other trick, 
without absolute referencing, it's hard to tell exactly where it's 
looking for file.wav
Hope that helps!
Jason

/--------------------------------------|---------------------------\
| Jason McIntosh                       | CELL: 573-424-7612        |
| Webmaster, thinker, Programmer, etc. | WORK: 573-884-3865        |
| http://poetshome.com/                |                           |
|------------------------------------------------------------------|
|"How should I know if it works?  That's what beta testers are     |
|for.  I only coded it."                                           |
|(Attributed to Linus Torvalds, somewhere in a posting)            |
\--------------------------------------|---------------------------/
GnuPG Key:  
http://poetshome.com/about/jmcintosh_mlug.missouri.edu.gpgkey
On Mar 9, 2004, at 11:58 AM, Robert West wrote:

> At this point in time the mere mention of the Java
> programming language gives me a splitting headache and
> a strong urge to break something.
>
> I'm trying to play a simple wav file.  This is the
> code I'm using, almost copied exactly from the
> tutorial.  It generates no errors, but will not play
> the sound.
>
> Anyone got an idea on this one?
>
> audioClip clip = java.applet.Applet.newAudioClip(new
> URL("file://file.wav"));
> if(clip != null) {
>   clip.play();
> else
>   System.out.println("@#%$!");
>
>
>
>
> 	
> 		
> Mit schönen Grüßen von Yahoo! Mail - http://mail.yahoo.de
> _______________________________________________
> members mailing list
> EMAIL:PROTECTED
> http://mlug.missouri.edu/mailman/listinfo/members


_______________________________________________
members mailing list
EMAIL:PROTECTED
http://mlug.missouri.edu/mailman/listinfo/members