473,396 Members | 1,724 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Playing sound on Button press

How can i output sound on button press in java?

I've used Jframe for button creation!

Plz help me!!
All i need is a simple beep sound when the button is pressed!
Aug 26 '07 #1
2 3643
Nepomuk
3,112 Expert 2GB
How can i output sound on button press in java?

I've used Jframe for button creation!

Plz help me!!
All i need is a simple beep sound when the button is pressed!
Produce a beep with:
Expand|Select|Wrap|Line Numbers
  1. import java.awt.Toolkit;
  2. ...
  3. Toolkit.getDefaultToolkit().beep();
  4.  
Just put the last part into you buttons actionListener.
Aug 27 '07 #2
r035198x
13,262 8TB
How can i output sound on button press in java?

I've used Jframe for button creation!

Plz help me!!
All i need is a simple beep sound when the button is pressed!
Just put
Expand|Select|Wrap|Line Numbers
  1. java.awt.Toolkit.getDefaultToolkit().beep();
in the actionPerformed method.
Aug 27 '07 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: didifouke | last post by:
Hi, I try to sample and playback speech using snack. My idea is to have a socket based server that plays back the sound and a client that samples the input from the sound card and sends it to...
0
by: MLH | last post by:
I just tested a small mde in A97 runtime environment on Win98 box. It has a wav file sound that plays fine on XP box. Does not play on Win 98 box. I get no error msg or anything of the sort. Just...
2
by: Dennis C. Drumm | last post by:
Using the Win API to play a sound with the code below in my Windows Form application. I get a huge delay (seems like application is hanging) just prior to the sound being played each time. Is this...
4
by: Jonesgj | last post by:
Hi All. I want to play a wav, MP3 or WMA file from my app. Is this easy to to? My old VB app would play a particle wav to attract the users attention if they were not at the terminal. I would...
0
by: a52 | last post by:
Hi everybody... I'm developing a Win32 App. There are some textbox in one form. in the KeyDown's events I have a code for change the textbox focus() when press Enter, but the enter key active a...
1
by: pkoziejko | last post by:
Hi! I have implemented psychoacustic Johnson model for wav files, and now I need to play data after modification. Now I have only playing *.wav using and PlaySound( "wav_file.wav",...
1
by: oops | last post by:
I've had no luck getting 2 sound files to start at the same time. the second one to start is delayed by about 3/4 of a second. Also would also prefer to start another clip a given point when one of...
4
by: Benzerari | last post by:
Hi All; Please, if any one knows the visual basic code, to be added to a Stop button in order to stop playing some sound of (*.Wav) type. I have achieved to find the code for start playing sound...
1
by: desturrr | last post by:
Hello all, I have small sized mp3 files that i can play via Java using JLayerPlayer that takes the address of mp3 files , JLayerPlayer objects can be played creating threads and starting. The...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.