I am working on a chat application in java. My program need to play sounds at regular interval as the message arrives. What are the sound format should I choose to play on (Windows/Linux/MacOS) platforms, without using external liberaries
Asked
Active
Viewed 309 times
2 Answers
1
Sound-formats are all platform independent. The question is: Is there a Codec on the target platform which supports this format.
If you're developing a chat-application i guess you won't use high quality audio things, so Sun Audio
-files should work for you. Check out this older post on how to use them.

Community
- 1
- 1

Lukas Knuth
- 25,449
- 15
- 83
- 111
-
I dont want to rely on a specific codec, there are some formats supported on almost all platforms/or you can say codecs available like midi format are there other alternatives too – Rajeev May 20 '11 at 09:19
-
The `Sun Audio`-format is available on every platform that supports the JVM. It comes with the Java Installation. – Lukas Knuth May 20 '11 at 09:49
0
For some reason .ao seems to be the lowest common denominator for Java, while .wav seems to be used almost everywhere else for notification-sounds (or possibly even .ogg or .mp3).

Alexander
- 9,737
- 4
- 53
- 59
-
1The thing with MP3 is that Java doesn't have native support for it. But you're right about .wav and .ogg – Lukas Knuth May 20 '11 at 09:50
-
Is .wav format supported on all platforms, I thought its native to windows. – Rajeev May 20 '11 at 10:53