Simple Sound Player Goal The goal of this assignment is to implement a simple sound player. The application has been partially implemented, and you need to complete the missing bits. When you open the project, you will see the class structure depicted below. Three of the classes are fully implemented…
Read the API doc for the Track class to see what parameters it takes in its constructor.
NormR1
Posting Sage
7,742 posts since Jun 2010
Reputation Points: 1,158
Solved Threads: 793
Skill Endorsements: 16
The reason why you get errors you don't understand, is because you didn't bother to try and understand what was going on, you just copy-pasted the codebase out of this thread without knowing anything about what files the OP had on his system.
you didn't even bother to rename the zip-file in which the OP of the last thread zipped his project, I think you didn't even bother to take his last version, in which some extra issues were solved.
if you really want to write an audio/wav/mp3/... player in java, my suggestion is: WRITE one in java. don't just show some code you don't know nothing about and can't explain anything about, so how are we going to have some help from your side? learn java. it's not like you need to know anything but core java to create an mp3 player in java, but you do have to understand something. if it's not core java, then at least the code you are working in, and as far as I've seen, you don't know neither of them. that's a bad place to start.
stultuske
Industrious Poster
4,366 posts since Jan 2007
Reputation Points: 1,318
Solved Threads: 610
Skill Endorsements: 23
by learning the basics. how far are you in your course, and what have you handled so far?
it's no use trying to code a media player if you don't understand/know the components you'll need.
it's like giving a toddler wood, hammer and nails, and expecting him to be able to build a desk. first learn what the nail is and does (your objects), check what your hammer (your calling class/method) is or the problems you can have with it and how to deal with it (exception handling).
these are just a few topics you'll need to understand before going over to larger projects.
stultuske
Industrious Poster
4,366 posts since Jan 2007
Reputation Points: 1,318
Solved Threads: 610
Skill Endorsements: 23
tell your teacher you still have questions and ask for more explanation.
Learning how to use a class name as a type for a variable right now.
that sentence allone tells me you 're not really familiar with what you're doing. you're not just using the classname, you are either instantiating a class or calling static members from class.
stultuske
Industrious Poster
4,366 posts since Jan 2007
Reputation Points: 1,318
Solved Threads: 610
Skill Endorsements: 23
How do I put (File soundFile) as the parameters in new Track()?
If Track has a constructor that accepts a File as a parameter, then just create a File and pass it, ie
File f = .... create the file as needed
track = new Track(f);
If Track does not have a constructor that accepts a File as a parameter, then you will have to create that constructor first...
public Track(File aFile) {
... do whatever the constructor needs to do
}
JamesCherrill
... trying to help
8,497 posts since Apr 2008
Reputation Points: 2,583
Solved Threads: 1,454
Skill Endorsements: 29
or look whether or not track has a set-method that accepts a File-parameter.
stultuske
Industrious Poster
4,366 posts since Jan 2007
Reputation Points: 1,318
Solved Threads: 610
Skill Endorsements: 23
in a setTrack method, I would expect an instance of Track being passed as parameter, something like this:
public void setTrack(Track newTrack){
this.track = newTrack;
}
stultuske
Industrious Poster
4,366 posts since Jan 2007
Reputation Points: 1,318
Solved Threads: 610
Skill Endorsements: 23