Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / January 2006

Tip: Looking for answers? Try searching our database.

J2ME 'click" sounds

Thread view: 
Tom Leylan - 01 Jan 2006 23:02 GMT
I'm looking for the best way to make various "clicking" sounds.  Not any old
sound, I can make tones I specifically need a click.

Thanks,
Tom
Luc The Perverse - 02 Jan 2006 09:11 GMT
> I'm looking for the best way to make various "clicking" sounds.  Not any
> old sound, I can make tones I specifically need a click.

Why can't you just play a prerecorded wav file?

Signature

LTP

:)
Tom Leylan - 02 Jan 2006 15:06 GMT
Thanks but that would be "because it is pre-recorded" :-)

A Wav file would be a recording of "a" click what would I do to click a bit
higher or lower or more rapidly or slower?  I can generate tones I can't
seem to find the combination of settings to generate a click.

>> I'm looking for the best way to make various "clicking" sounds.  Not any
>> old sound, I can make tones I specifically need a click.
>
> Why can't you just play a prerecorded wav file?
Darryl L. Pierce - 02 Jan 2006 18:51 GMT
> I'm looking for the best way to make various "clicking" sounds.  Not any old
> sound, I can make tones I specifically need a click.

What are you looking for, the sound file or a way of playing them? If
the latter, then be forewarned that you'll only be able to do it from
the Canvas and GameCanvas classes; i.e., you won't have access to key
stroke notifications from the high-level UI components.

Signature

Darryl L. Pierce <mcpierce@gmail.com>
Visit my homepage: <http://mcpierce.multiply.com>
"By doubting we come to inquiry, through inquiry truth." - Peter Abelard

Tom Leylan - 03 Jan 2006 02:07 GMT
Sorry I thought I would be clear enough.  Are you familiar with the
javax.microedition.media.Manager class?  It has a playTone method.  That
would be fine if I could get a click out of it or if somebody knows of a
better alternative I would use that.  I'm not worried about whether I get
key stroke notifications I just need a clicking sound to accompany something
I'm animating.

Do you think playing a wav file repeatedly in a tight loop would be a better
use of resources?

>> I'm looking for the best way to make various "clicking" sounds.  Not any
>> old sound, I can make tones I specifically need a click.
[quoted text clipped - 3 lines]
> Canvas and GameCanvas classes; i.e., you won't have access to key stroke
> notifications from the high-level UI components.
Roedy Green - 03 Jan 2006 03:21 GMT
On Sun, 1 Jan 2006 18:02:28 -0500, "Tom Leylan"
<gee@iamtiredofspam.com> wrote, quoted or indirectly quoted someone
who said :

>I'm looking for the best way to make various "clicking" sounds.  Not any old
>sound, I can make tones I specifically need a click.

See my NetworkCam.  I make  camera click sounds by playing au files.
http://mindprod.com/applets/networkcam.html
Signature

Canadian Mind Products, Roedy Green.
http://mindprod.com Java custom programming, consulting and coaching.

Tom Leylan - 03 Jan 2006 06:16 GMT
Hi Roedy (I've seen your postings and your site):

I dl'd your NetworkCam to check the code and you're using the AudioClip
class I believe.  I don't have that in J2ME as far as I know.

In any case I was messing around with the.ToneControl and Player classes and
I'm closer.  It's an electronic "blip" now which is close enough for my
little animation.  I can probably tweak it a bit more to get the
"flute-iness" out of it (it sounds like a flute) but if I can't it will have
to do.  The nice thing about not playing a pre-recorded file is of course
that the tone can be modified as it runs.

Tom

> On Sun, 1 Jan 2006 18:02:28 -0500, "Tom Leylan"
> <gee@iamtiredofspam.com> wrote, quoted or indirectly quoted someone
[quoted text clipped - 6 lines]
> See my NetworkCam.  I make  camera click sounds by playing au files.
> http://mindprod.com/applets/networkcam.html
Oliver Wong - 10 Jan 2006 21:14 GMT
> I'm looking for the best way to make various "clicking" sounds.  Not any
> old sound, I can make tones I specifically need a click.

   I'm not sure what API J2ME exposes for tone generation, but if you want
to generate a "click"-like tone, it's simply a matter of doing a suddenly
quick change in amplitude in the waveform, or a suddenly quick change in
slope of the waveform.

   - Oliver
Darryl L. Pierce - 11 Jan 2006 16:14 GMT
>     I'm not sure what API J2ME exposes for tone generation

It has none. Your only option is to play existing sound files.

Signature

Darryl L. Pierce <mcpierce@gmail.com>
Homepage: http://mcpierce.multiply.com/
"McVeigh's lawyer got him the death penalty, which, quite frankly,
I could have done." - Jon Stewart

Tom Leylan - 12 Jan 2006 03:10 GMT
>> I'm looking for the best way to make various "clicking" sounds.  Not any
>> old sound, I can make tones I specifically need a click.
[quoted text clipped - 3 lines]
> quick change in amplitude in the waveform, or a suddenly quick change in
> slope of the waveform.

I know this is going to sound rude but how does that constitute the "best
way"?  I see another reply that reports that J2ME doesn't support tone
generation and it only supports playing existing sound files... that of
course comes as a shock to the developers of J2ME I'm certain.  I even wrote
"I can make tones" so that would hardly seem to be the case right?

Where are the real answers posted? :-)
Oliver Wong - 12 Jan 2006 15:23 GMT
>>> I'm looking for the best way to make various "clicking" sounds.  Not any
>>> old sound, I can make tones I specifically need a click.
[quoted text clipped - 6 lines]
> I know this is going to sound rude but how does that constitute the "best
> way"?

   I am not a sound engineer, but perhaps a quick change in the amplitude
or slope is the "best" way because it is the "only" way. Again, I'm not sure
what API you have access to, but if you're just setting amplitudes at
various points in time, setting the amplitude is probably "easier" (in that
it doesn't involved calculus), but depending on the values chosen, you may
get "pops" instead of "clicks". I haven't played around with sudden slope
changes much, so I don't know, assuming a uniformly random distribution of
all possible slope changes, whether the probability of getting a "click"
instead of a "pop" (or any other sound) is better than a sudden change in
amplitude.

>  I see another reply that reports that J2ME doesn't support tone
> generation and it only supports playing existing sound files... that of
> course comes as a shock to the developers of J2ME I'm certain.  I even
> wrote "I can make tones" so that would hardly seem to be the case right?

   Perhaps your tone generating API is an vendor specific extension, and
not actually part of the J2ME standard? Again, just speculating here,
because I'm not familiar with that portion of the J2ME spec.

> Where are the real answers posted? :-)

   If you can generate tones, and you specifically want to generate this
click sound (and not use existing sound files), it seems like your question
is not nescessarily Java-specific. You just want equations for waveforms
describing clicking sounds, right? So maybe this is the wrong newsgroup to
ask this question in.

   - Oliver
Tom Leylan - 13 Jan 2006 01:53 GMT
"Oliver Wong" <owong@castortech.com> wrote...

Oliver let me say "it's a pleasure to converse with you" since you didn't
just assume I meant to be rude :-)

>    I am not a sound engineer, but perhaps a quick change in the amplitude
> or slope is the "best" way because it is the "only" way.

You could be right but then the "opportunity for fame and fortune" bell must
ring since in all likelihood lots of people want to beep the speaker without
resorting to prerecorded files of various formats.  If it couldn't click it
I'd hardly write an app, I'd write an extension for this :incredible missing
ability" and retire on the profits :-)

>    Perhaps your tone generating API is an vendor specific extension, and
> not actually part of the J2ME standard? Again, just speculating here,
> because I'm not familiar with that portion of the J2ME spec.

It seems possible that the tone generator isn't supported on some branded
phones.  That would be something I would expect could be tested through
software but hey I can be wrong too.  Motorola says it works for them I've
now asked them if Cingular could have messed it up. :-)

>> Where are the real answers posted? :-)
>
[quoted text clipped - 3 lines]
> waveforms describing clicking sounds, right? So maybe this is the wrong
> newsgroup to ask this question in.

Not exactly.  It is J2ME specific since the spec says it can generate tones
and I generate tones using J2ME.  I'm trying to get a specific "frequency of
tone" (FOT) :-) that wouldn't be a beep but would generally be accepted as a
click sound.  My basic working theory is if it can generate (by any means)
voice and music then click has got to be in there somewhere.  Nobody
accomplishes voice without first accomplishing click. :-)  A 440 cycle per
second "A above middle C" is (as you know) just clicking at a particular
rate of speed.

In any case I'll find it, thanks again for your understanding.

Tom
Darryl L. Pierce - 12 Jan 2006 17:47 GMT
> Where are the real answers posted? :-)

My answers are based on real-world development experience with the MIDP
(since 1999) and knowledge of the APIs.

Signature

Darryl L. Pierce <mcpierce@gmail.com>
Homepage: http://mcpierce.multiply.com/
"McVeigh's lawyer got him the death penalty, which, quite frankly,
I could have done." - Jon Stewart

Darryl L. Pierce - 12 Jan 2006 17:52 GMT
>> Where are the real answers posted? :-)
>
> My answers are based on real-world development experience with the MIDP
> (since 1999) and knowledge of the APIs.

[Open mouth, insert foot]

Damn. The MMAPI API provides the ToneControl class which generates
tones. Completely forgot about that since I've never used it...

Signature

Darryl L. Pierce <mcpierce@gmail.com>
Homepage: http://mcpierce.multiply.com/
"McVeigh's lawyer got him the death penalty, which, quite frankly,
I could have done." - Jon Stewart

Tom Leylan - 13 Jan 2006 01:55 GMT
No problem Darryl... thanks for your fessing up.  The online world isn't as
doomed as it sometimes seems :-)

>>> Where are the real answers posted? :-)
>>
[quoted text clipped - 5 lines]
> Damn. The MMAPI API provides the ToneControl class which generates tones.
> Completely forgot about that since I've never used it...


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.