aspose file tools
The moose likes Beginning Java and the fly likes Running audio files through java application Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


JavaRanch » Java Forums » Java » Beginning Java
Reply Bookmark "Running audio files through java application" Watch "Running audio files through java application" New topic
Author

Running audio files through java application

Mahajan Bhupendra
Ranch Hand

Joined: Dec 01, 2000
Posts: 118
Hi i want to play a tune in java application the code in have
written for is...
<pre>
import sun.audio.*;
import java.io.*;
class au
{
public static void mian(String args[]) throws Exception
{
InputStream in = new FileInputStream("D:\\jdk1.3\\mb\\bottle-open.wav");
AudioStream as = new AudioStream(in);
AudioPlayer.player.start(as);
}
}
</pre>
it's compling successfully but giving runtime error..
Exception in thread "main" java.lang.NoSuchMethodError: main
what's wrong ??
Tnax in advance..
bhupendra


<B>Bhupendra Mahajan</B>
Peter Kristensson
Ranch Hand

Joined: Jul 02, 2001
Posts: 118
You misspelled "main", your code reads "mian"
/Peter
Mahajan Bhupendra
Ranch Hand

Joined: Dec 01, 2000
Posts: 118
Tankx peter it worked..
so dumb i m..
Originally posted by Peter Kristensson:
You misspelled "main", your code reads "mian"
/Peter

 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: Running audio files through java application
 
Similar Threads
Where to park my abc.wav file in the Netbeans IDE
Sound problem in Java
How do I loop the sound file in this program>
Playing wav - java.io.FileNotFoundException when file is def there
Problem playing sound from application