This week's book giveaway is in the Programmer Certification forum.
We're giving away four copies of OCP Oracle Certified Professional Java SE 21 Developer (Exam 1Z0-830) Java SE 17 Developer (Exam 1Z0-829) Programmer’s Guide and have Khalid Mughal and Vasily Strelnikov on-line!
See this thread for details.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • paul wheaton
  • Ron McLeod
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Piet Souris
Bartenders:

beep with time and frequency

 
Ranch Hand
Posts: 63
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello:
In java.awt.Toolkit we have the beep() mehtod to emit an audio beep. I would know if there is a similar method to etmit a beep in a certain frequency (in Hertz) for a certain time (in seconds or milliseconds). It will be like:

Thanks,
 
Ranch Hand
Posts: 1923
Scala Postgres Database Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
There is an Article on JDC Tech Tips.
It's not that simple, but on the other hand, not too complicated, and explained in Detail:
http://java.sun.com/jdc/JDCTechTips/2003/tt0805.html
 
Rafael Afonso
Ranch Hand
Posts: 63
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Stephan:
Thanks, but I do not want anything relationed to Java Media or Multimedia. I want a simpler thing. I remember that in Turbo Pascal (or Turbo C) there is a function similar what I want. But I do not remember what its name and I do not find it anywhere in Internet. Does someone know?
Thanks,
 
author and iconoclast
Posts: 24207
46
Mac OS X Eclipse IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
In any event, there's no such function in the Java API. If you need to play particular sounds, you have no choice but to use the Java Media API.
 
Stefan Wagner
Ranch Hand
Posts: 1923
Scala Postgres Database Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Well - it's really not complicated (even me, who knows nothing about midi, ogg, mp3, au and wav solved it).
The alternative 1 would be to implement it in c/c++ and call a native interface - more complicated in my opinion and not portable, but with the benefit that it will run on computers without soundcard
And the second: implement as well in a different language, but make it executable, and call Runtime...
Both suffer from the fact, that there is no volume - control to the user.
If the users have a very old jvm, it could be an argument.
 
Rafael Afonso
Ranch Hand
Posts: 63
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello:
That is the question: I don't want use card sound. So, it seems that I would need JNI to create a *.DLL or *.SO. Is there a library in C or Pascal that can do it?
Thanks,
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic