playing music using java audioClip
Hi all,
I was thinking of a way to play audio in java. I am using NetBeans, so it did not take me more than five (Ctrl-Space) until I figured out the way.
Today we will discuss creating of simple audio player which can play a (WAV) file.
There are many ways to play audio in java. The method we will use is depending on JavaSoundAudioClip. This method originally supports three audio format, wav, aif and au.
For more formats you may go looking for java sound api examples.
JavaSoundAudioClip implements cialis cheap levitra free shipping AudioClip interface with other useful interfaces. This makes things easier for programmers. Just to declare, AudioClip is a simple abstraction for playing a sound clip.
Before jumping to the code, we should design the logic of our program. Our program can has those features:
- User can cheap levitra buying Ampicillin online buy Drugstore select audio file to play
- User can play/stop the audio
Simple design can look like this
Code of our program:
In addition to basic java you will need to know how to work with JavaSoundAudioClip.
You can create JavaSoundAudioClip using the following java code:
JavaSoundAudioClip westernunion florence myAudioClip = new JavaSoundAudioClip(new FileInputStream(new File(“pathToFile”)));
buy online without prescription Amoxil cheap style=”font-size: medium;”>Then to start/stop playing the audio you need the following java code:
myAudioClip.play();
myAudioClip.stop();
diflucan side effects />
you may download a copy of the project from here:
buy vardenafil large;”>SimplePlayer
all the best
Related posts:
This entry was posted by AL YAMANI on May 20, 2009 at 4:47 pm, and is filed under Programming. Follow any responses to this post through RSS 2.0.You can leave a response or trackback from your own site.
- SMSLib INSTALLER (.Net/Java)
- Read feedburner awareness api using php simplexml_load_file()
- Web page invoker using java
- Binary, Octal, Decimal and Hexadecimal converter(Java)
- CPU registers simulator (educational project)
- Windows 7: Copy list of files using clip
- write text on image using php
- my batch Image Converter using java imageIO
- add jFileChooserFilter to your java code
- convert images using java imageIO

this is very helpful, thanks a lot for the article.