J2ME 'click" sounds

T

Tom Leylan

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
 
L

Luc The Perverse

Tom Leylan 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.


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

Tom Leylan

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.
 
D

Darryl L. Pierce

Tom 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.

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.
 
T

Tom Leylan

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?
 
T

Tom Leylan

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
 
O

Oliver Wong

Tom Leylan 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.

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
 
T

Tom Leylan

Oliver Wong said:
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.

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? :)
 
O

Oliver Wong

Tom Leylan said:
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
 
D

Darryl L. Pierce

Tom said:
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.
 
D

Darryl L. Pierce

Darryl said:
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...
 
T

Tom Leylan

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. :)
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.

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
 
T

Tom Leylan

No problem Darryl... thanks for your fessing up. The online world isn't as
doomed as it sometimes seems :)

Darryl L. Pierce said:
Darryl said:
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...

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

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,537
Members
45,020
Latest member
GenesisGai

Latest Threads

Top