Results 1 to 6 of 6
- 02-08-2011, 07:48 PM #1
Member
- Join Date
- Feb 2011
- Posts
- 3
- Rep Power
- 0
Play soundclip and generate"wind" like sound
Hi,
My knowledge in Java are very limited and I need to do a program for a project. However, I can't find how to do it.
2 things :
1)
I want to play a soundclip. It can be a wav, a mp3, whatever will be the easiest to read I don't care since I will create that file and it will never change it after. This sound will happen when a specific event happen. I download the Demo of the Java Sound API from the official Java website, but it is quite hard for me to understand how to just read a simple file.
Also, that file will be a Mono file, wich I want to be able to gage the volume in 3D (2 fronts, 2 rears)... I don't know if something like that is possible in Java.. especially with my knowledge. In the worst case, a left/right balance could do it.
2)
I need to generate a sound that will give a wind effect that will be more or less loud depending on parameters coming from an external sensor. I have absolutly no idea how to do that, but i though maybe i could use the MIDI sounds using an instrument like "helicopter" or something like that.
The first part is the most important one, it is essential to the project.
Any idea :confused: I'm really lost with all that.
- 02-08-2011, 07:59 PM #2
- Join Date
- Sep 2008
- Location
- Voorschoten, the Netherlands
- Posts
- 11,375
- Blog Entries
- 7
- Rep Power
- 17
Have a look at the static method Applet.newAudioClip( ... ); it loads a clip and you can play, loop and stop it. Personally I still wonder why this is a static method in the Applet class.
kind regards,
JosWhen people rob a bank they get a penalty; when banks rob people they get a bonus.
- 02-08-2011, 08:36 PM #3
Member
- Join Date
- Feb 2011
- Posts
- 3
- Rep Power
- 0
I just tried it, and trying to read a song converted to wav makes a very slow reading, like if a buffer was always full or something like that :P and one of my core is almost at 85% (i have a T9600 wich should be far enough :P). Any idea why it does that?
Edit : Ok well I just loaded a short clip (about 1 sec.) and it looks fine.Last edited by diablo2070; 02-08-2011 at 08:51 PM.
- 02-08-2011, 11:04 PM #4
WAVs are huge and java doesn't natively decode mp3. You can look at JLayer for mp3 decoding, but thats quite a bit of work/learning curve. For simple games and the like, WAV and AIFF are fine - assuming you don't have any huge audio tracks.
- 03-13-2011, 08:18 PM #5
Member
- Join Date
- Feb 2011
- Posts
- 3
- Rep Power
- 0
The method Applet.newAudioClip( ... ) works fine for my needs, but I really can't find a way to control gain. I'm leaving the idea of surround, but i would at least want to be able to control gain. I've searched a lot on the internet but I can't find any way to control gain with that method. Anyone has an idea?
Thanks
- 03-13-2011, 08:47 PM #6
Similar Threads
-
connection = DriverManager.getConnection(DATABASE_URL,'"+userid +"','"+password+"');
By renu in forum New To JavaReplies: 3Last Post: 10-12-2010, 04:21 PM -
Is there a way to play the video until I click the "start "button?
By aprilcomingsoon in forum XMLReplies: 0Last Post: 06-07-2010, 06:23 PM -
How to change my form design from "metal" to "nimbus" in Netbeans 6.7.1?
By mlibot in forum New To JavaReplies: 1Last Post: 01-21-2010, 09:20 AM -
MoneyOut.println("It took you (whats wrong?>",year,"<WW?) years to repay the loan")
By soc86 in forum New To JavaReplies: 2Last Post: 01-24-2009, 06:56 PM -
the dollar sign "$", prints like any other normal char in java like "a" or "*" ?
By lse123 in forum New To JavaReplies: 1Last Post: 10-20-2008, 07:35 AM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks