Use error.printStackTrace() instead of just printing "file not found".
Ezzaral
null
16,126 posts since May 2007
Reputation Points: 3,294
Solved Threads: 875
Skill Endorsements: 28
Code works for me. I changed the .wav reference to a local file:
NormR1
Posting Sage
7,742 posts since Jun 2010
Reputation Points: 1,158
Solved Threads: 793
Skill Endorsements: 16
BGM = new AudioStream(new FileInputStream("Audio/mysound.wav"));
NormR1
Posting Sage
7,742 posts since Jun 2010
Reputation Points: 1,158
Solved Threads: 793
Skill Endorsements: 16
Sorry, I don't know anything about your IDE.
NormR1
Posting Sage
7,742 posts since Jun 2010
Reputation Points: 1,158
Solved Threads: 793
Skill Endorsements: 16
> i have a bunch of warning signs on a bunch of my lines in the program. is it possibly because of my settings in eclipse?
Well, reading them seems to be a good place to start?
Ezzaral
null
16,126 posts since May 2007
Reputation Points: 3,294
Solved Threads: 875
Skill Endorsements: 28
I don't use an IDE. I have an enhanced editor with syntax highlighting and commmandlines I can set. Compiles can take < 1 second.
NormR1
Posting Sage
7,742 posts since Jun 2010
Reputation Points: 1,158
Solved Threads: 793
Skill Endorsements: 16
Eclipse is obviously not happy that you are directly accessing sun classes. Those are just warnings though and won't prevent you from using them.
Did you change your catch block to print the stack trace of the IOException?
Ezzaral
null
16,126 posts since May 2007
Reputation Points: 3,294
Solved Threads: 875
Skill Endorsements: 28
Have you tried a different wav file?
Ezzaral
null
16,126 posts since May 2007
Reputation Points: 3,294
Solved Threads: 875
Skill Endorsements: 28
I wouldn't think so. Perhaps it was just an incompatible file or it was corrupted.
Ezzaral
null
16,126 posts since May 2007
Reputation Points: 3,294
Solved Threads: 875
Skill Endorsements: 28
Question Answered as of 2 Years Ago by
Ezzaral
and
NormR1 1)Please do not hijack old thread.
2)The answer of how to run it should already be in those posts (using AudioStream class).
Taywin
Posting Maven
2,633 posts since Apr 2010
Reputation Points: 275
Solved Threads: 376
Skill Endorsements: 17