Page 1 of 1

Sound (Tone) Generation: beep (freq, duration)

PostPosted: Jun 30, 2002 @ 11:42pm
by Guest
How would you go about doing the following?

I'd like to generate tones for specific durations (dynamically) on the pocketPC. I've checked into several sound libs and can't find any that give me the ability to do the following:

beep (frequency, duration in ms)

A simple use of this function might be to create a morse code utility. It could be used for more complex apps that handle full protocols, etc.

Ideally, this function would work like several you've seen in PC APIs (interruptable, multiple "beeps" running concurrently, ...).

Any ideas?

Is it possible?

Thanks -
dxmonger@yahoo.com

PostPosted: Jul 1, 2002 @ 2:06am
by britcode

PostPosted: Jul 1, 2002 @ 7:11pm
by Guest
Thanks for the reply, Britcode.

I think you have the general idea as to what I'd like to do... simply generate one or two sines (or other waveforms) in a controlled (strict time slice) manner. Again, ideally, I'd love to have a function that did something like:

beep (frequency, duration)

but I can't find it.

Someone pointed out that the application, Pocket Oscillator <http://www.pocketgear.com/software_detail.asp?id=3861> does allow you to create (and mix) multiple sine waves (so it's certainly possible). You pointed out that pocketpcdn.com offers tutorials on sampled sound. I can find plenty of examples to play a wav file (via PlaySound() and other calls or GAPI), but nothing that gives me the ability to do this on my own.

I guess I'm still struggling a bit with getting this off the ground. First thing's first:

What language would you do this in?

Are there any libraries that would allow me to do this easier? I've looked at fmod, but that is more geared towards playing a wav than generating a tone.

I'm kinda thinking that I'd be forced to write an assembly routine to call the sound/speaker system (ug).

Additional help is appreciated!

PostPosted: Jul 1, 2002 @ 8:44pm
by britcode
>I'm kinda thinking that I'd be forced to write an assembly routine to call the sound/speaker system (ug).

Nono - just use the waveOpenOut functions, no need for assembler. Check out msdn.microsoft.com or the example on pocketpcdn if there is one.
Sadly there is no beep function.
I recommend you program in C/C++.