The Java Sound engine can render 8 or 16-bit audio data, in mono or stereo, with sample rates from 8KHz to 48KHz, that might be found in streaming audio or any of the supported file formats. You can also play *.au, *.wav, *.midi (SMP 0, SMF (Standard MIDI Format) 1 and RMP (RealPlayer Metadata Package)) and *.aiff files with java.applet. AudioClip. play. For *.au files use G.711 µ-law format did not originally support PCM (Pulse-Code Modulation). Originally, you could use only 8-bit, 8000 Hz (Hertz), single-channel (mono) NEXT/Sun *.au files with G.711 µ-law compression. However JDK 1.8.0_131+ does play PCM_SIGNED 8000.0 Hz, 8-bit, 64 kpbs, mono. Java supports only 8 KHz to 48 KHz.
In my Vercheck app, I used Sun PCM_SIGNED 8000.0 Hz, 8-bit, 64 kpbs, mono.
If your files are in other formats such as *.mp3, you can use a utility like Goldwave to convert them. Unfortunately, not all *.wav files or all *.midi files will play. You just have to test them.
Using AudioClip, I have managed to get *.wav and *.au files to work on Vista, but not *.midi or *.mp3.
RealPlayer is required for *.ra files. AudioClip has been around since JDK 1.0.
You can use javax.sound.midi to play MIDI (Musical Instrument Digital Interface) files. It has been around since JDK 1.3.
You can use javax.sound.sampled.SourceDataLine can be used to merge sampled datastreams and play a variety of sound files. It has been around since JDK 1.3.
is not very bright. If you call it while a sound is playing, it will not wait for that first sound to complete. It plays the two sounds on top of each other.
Here is a technique to introduce time delays to avoid overlap.
In a similar way, you can use javax.sound.midi to play midi files.Audio Format MIME Type And Extensions Associated With Them | |||
---|---|---|---|
Extension | MIME Type | Alternate MIME Types | Notes |
3gpp | audio/3gp | audio only, also 3gp | |
aac | audio/aac | audio/MP4-LATM, audio/x-aac, audio/x-mp4 | Apple QuickTime compressed audio used in iPods |
aif | audio/x-aiff | MacIntosh sound | |
aifc | audio/x-aiff | MacIntosh sound | |
aiff | audio/x-aiff | MacIntosh uncompressed sound | |
asf | video/x-ms-asf | Microsoft media audio and/or video | |
au | audio/basic | audio/x-pn-au | standard Unix/Internet/Java uncompressed wave sound |
avi | video/avi | video/x-msvideo | earlier Microsoft video format. avi movie, works with Winamp (best), MS Media Player (often audio only), or QuickTime (in theory) |
cht | audio/x-dspeech | ||
dus | audio/x-dspeech | ||
es | audio/echospeech | ||
gsd | audio/gsm | ||
gsm | audio/gsm | ||
kar | audio/midi | ||
m3u | audio/x-mpegurl | redirect to audio url | |
m4a | audio/mp4 | MPEG-4 Audio | |
m4u | audio/x-mpegurl | video/vnd.mpegurl | redirect to audio url |
mid | audio/x-midi | audio/midi | MIDI sound |
midi | audio/x-midi | audio/midi | MIDI sound |
mp2 | audio/mpeg | audio/x-mpeg | |
mp3 | audio/mp3 | audio/mpeg, audio/x-mp3, audio/x-mpg | mp3/mpeg compressed audio. Popular format for portable music players. |
mp4 | video/mp4 | ||
mpeg | video/mpeg | mpeg movie player | |
mpga | audio/mpeg | ||
oga | audio/ogg | Ogg audio | |
ogg | audio/x-oggvorbis | application/ogg | encapsulation for Vorbis I non-proprietary audio or video. |
ogx | application/ogg | muliplex ogg stream | |
ra | audio/x-pn-realaudio | Real Audio | |
ram | audio/x-pn-realaudio | Real Audio | |
rm | audio/x-pn-realaudio | application/vnd.rn-realmedia | Real Audio |
rmf | audio/rmf | audio/x-rmf | |
rmm | audio/x-pn-realaudio | ||
rmp | application/vnd.rn-rn_music_package | RealPlayer Metadata Package File, playlist | |
rms | audio/x-realaudio-secure | ||
rpm | audio/x-pn-realaudio-plugin | Real Audio | |
snd | audio/basic | standard Internet/Java wave sound | |
soundpack | application/octet-stream | Stardock Windows audio themes | |
stream | audio/x-qt-stream | ||
tsi | audio/tsplayer | ||
vox | audio/voxware | ||
vqe | audio/x-twinvq-plugin | ||
vqf | audio/x-twinvq | ||
vql | audio/x-twinvq | ||
wav | audio/wav | audio/x-pn-windows-pcm, audio/x-wav | Microsoft wave uncompressed sound files |
wax | audio/x-ms-wax | Microsoft compressed audio | |
wma | audio/x-ms-wma | Microsoft compressed audio | |
wmv | video/x-ms-wmv | Microsoft compressed video. Play with Windows media Player or Winamp. Winamp lets you slide forward and back. | |
wtx | audio/wtx | ||
xaml | application/xaml+xml | Silverlight |
Euphonious Windows Sounds | |||
---|---|---|---|
Theme | Sound Name | Where | Comments |
Afternoon | Deskop Mail Notification | "C:\Windows\media\Afternoon\Windows Notify.wav" | Ding Dong |
Afternoon | Print Complete | "C:\Windows\media\Afternoon\Windows Print complete.wav" | Three note guitar riff |
Cityscape | Critical Battery Alarm | "C:\Windows\media\Cityscape\Windows Battery Critical.wav" | reminiscent of West Side Story |
Cityscape | Device Failed to Connect | "C:\Windows\media\Cityscape\Windows Hardware Fail.wav" | Jazzy |
Delta | Low Battery Alarm | "C:\Windows\media\Delta\Windows Battery Low.wav" | reminiscent of dueling banjos |
Festival | Exclamation | "C:\Windows\media\Festival\Windows Exclamation.wav" | Mariachi trumpet fanfare |
Garden | Critical Stop | "C:\Windows\media\Garden\Windows Critical Stop.wav" | A strum on some primitive stringed instrument. |
Heritage | Incoming Call | "C:\Windows\media\Heritage\Windows Ringin.wav" | old fashioned telephone bell. |
Landscape | Fax Sent | C:\Windows\media\Landscape\tada.wav | ta-da! |
Quirky | Print Complete | "C:\Windows\media\Quirky\Windows Print complete.wav" | Star Treky sound |
Raga | Critical Stop | "C:\Windows\media\Raga\Windows Critical Stop.wav" | brrrr plop |
Savanna | Default Beep | "C:\Windows\media\Savanna\Windows Ding.wav" | Balalaika strike |
Sonata | Print Complete | "C:\Windows\media\Sonata\Windows Print complete.wav" | pizzicato |
Of course, you can scan the net for WAV files to replace the Microsoft sounds, e.g. HAL (Heuristic Algorithmic) saying human error. Keep in mind, when you change themes, your sounds may be replaced too.
Here are some places where you can find canned sounds: SoundAmerica, Sound collection links. Vista no longer comes with a rich set of sounds, so you have to find them on the web.
Windows 10 comes with a nice assortment of visual themes and sound themes including:
Windows 10 Sound Schemes | ||
---|---|---|
Name | Where | What It Sounds Like |
Afternoon | C:\Windows\media\Afternoon\ | acoustic guitar |
Calligraphy | C:\Windows\media\Calligraphy\ | Chinese instruments |
Characters | C:\Windows\media\Characters\ | electric guitar |
Cityscape | C:\Windows\media\Cityscape\ | vibraphone |
Delta | C:\Windows\media\Delta\ | Mississippi |
Festival | C:\Windows\media\Festival\ | trumpet |
Garden | C:\Windows\media\Garden\ | chimes |
Heritage | C:\Windows\media\Heritage\ | Spanish guitar |
Landscape | C:\Windows\media\Landscape\ | symphonic |
Quirky | C:\Windows\media\Quirky\ | electronic |
Raga | C:\Windows\media\Raga\ | sitar |
Savanna | C:\Windows\media\Savanna\ | pizzicato |
Sonata | C:\Windows\media\Sonata\ | violins |
This page is posted |
http://mindprod.com/jgloss/sound.html | |
Optional Replicator mirror
|
J:\mindprod\jgloss\sound.html | |
Please read the feedback from other visitors,
or send your own feedback about the site. Contact Roedy. Please feel free to link to this page without explicit permission. | ||
Canadian
Mind
Products
IP:[65.110.21.43] Your face IP:[98.84.18.52] |
| |
Feedback |
You are visitor number | |