Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

beep with time and frequency

 
Rafael Afonso
Ranch Hand
Posts: 63
  • Mark post as helpful
  • send pies
  • 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,
 
Stefan Wagner
Ranch Hand
Posts: 1923
Linux Postgres Database Scala
  • Mark post as helpful
  • send pies
  • 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
  • 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,
 
Ernest Friedman-Hill
author and iconoclast
Marshal
Pie
Posts: 24211
35
Chrome Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • 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
Linux Postgres Database Scala
  • Mark post as helpful
  • send pies
  • 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
  • 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,
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic