Email address obfuscation in effect -- please
click here to turn it off.
[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
Um, the url you'd probably want to use, if a windows client is running
the applet, is this:
file://C:\directory\myfile.wav
Sometimes, just having the wav file in the classpath doesn't work.
Primarily due to how the applet system works, and the protections
there, and what it can and can't see. You could try loading a File
object,
File my_file = new File("C:\directory", "myfile.wav");
if (my_file.exists())
System.out.println("Found the file!");
else
throw new Exception("ERROR! File not found!");
AudioClip clip = java.applet.Applet.newAudioClip(file.toURL());
Try something like that. I'm not sure of the exact parameters on the
clip. Further, usually if it can't open the file or understand it's
format, check to make sure that it is throwing an error, and make sure
you're catch statements are actually outputing to system.err or
system.out the various errors. Right now, it still sounds like an
issue with your settings. If you want to email me the .java files, I
can take a look real quick and probably fix it for you.
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 1:44 PM, Robert West wrote:
> It's running as a standalone app. The only reason for
> the URL format is it is a requirement for using either
> SoundList.java (from the java tutorial), or
> Applet.newAudioClipe(URL u). The file is in the
> sounds subdirectory of where the class file is.
>
> It isn't generating an error, but the sound doesn't
> play.
>
> Thanks for the help guys.
>
> Roger
> --- "Christian M. Cepel" <EMAIL:PROTECTED>
> schrieb: > Darn.. I was hoping the first response
> would be a
>> smart-alec asking if
>> he had a soundcard installed.
>>
>> //Christian
>>
>> Jason McIntosh wrote:
>>
>>> 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
>>>
>>
>>
>> --
>>
>> //Christian
>>
>> Christian Marcus Cepel | And the wrens
>> have returned &
>> EMAIL:PROTECTED icq:12384980 | are nesting; In
>> the hollow of
>> 371 Crown Point, Columbia, MO | that oak where
>> his heart once
>> 65203-2202 573.999.2370 | had been; And he
>> lifts up his
>> Computer Support Specialist, Sr. | arms in a
>> blessing; For being
>> University of Missouri - Columbia | born again.
>> --Rich Mullins
>>
>> _______________________________________________
>> members mailing list
>> EMAIL:PROTECTED
>> http://mlug.missouri.edu/mailman/listinfo/members
>
>
>
>
> 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