Android Question Variometer type tone generator

andyp

Member
Licensed User
I am trying to generate 'variometer' type tones within my app. This website has a vario simulator which gives a good idea of the type of tones I am trying to generate: https://www.xctracer.com/en/user-manual/33/?oid=1874&lang=en

My app is not a variometer - I am using tones to indicate distance to or from a point.

Currently I am using the Beeper library - this works 'ok' - using a beeper length of 25ms, and tones of 300-500 Hz as I get closer to a point, and 850-1600Hz as I pass the point. When at the location +/- some distance there is no tone.

But I would like:
- Continuous beep (with changing tone) the closer I get (approach tone)
- Pulsed beep of shorter duration / higher pulse frequency (with changing tone) after I pass the location (departure tone)

I tried increasing the duration of the beep (500-1000ms) for the approach tone - this makes it continuous, but then the tone continues at the location. I can mute the phone at the location, and unmute it as it passes - but then I can still sometimes hear the end of the approach tone underneath the new departure tone.

I also have the problem of too many beepers eventually crashing the app.

The app receives distance over bluetooth - when a new distance is received, I check the distance to location and start a beeper with tone based on this distance.

Is there any better way of doing this?

Thanks you!
 

andyp

Member
Licensed User
A bit of an update - I found using b.Release immediately prior to starting a new tone seems to have eliminated the app crashing after lots of beeps…..

And using the equation y = mx+c for both duration and frequency has let me do a nice departure tone.

So the arrival tone is the remaining problem. I have the beep length at 4000ms (which should give a continuous beep on approach, as the distance changes are variable but always less than 4000ms apart), and the frequency changes based on y=mx+c. I use b.Release prior to each new beep frequency, and also use b.Release to immediately stop the tone at location.

There is a rather annoying ‘static‘ type sound from the speaker when (I think) using b.Release to stop the current beep before starting a new one. This static can be eliminated by setting the volume to 0 before releasing, then back to max volume after.

It now all works ok, but there are small gaps in the arrival tone (I guess from current tone playing, volume 0, release, volume max, new tone). I would like to have the arrival tone continuous and continuously varying in frequency - but don't quite see how to achieve this.

I know I am using beep outside its scope. Is there an alternative to try and give a variable tone with no gaps?
 
Last edited:
Upvote 0

andyp

Member
Licensed User
AudioStreamer seems to work well to generate tones.

Is there any way to stop the request - for example - CallSub3(Starter, "Beep", 1000, 400) - before the 1000ms is up? With beeper I can b.Release - is there anything similar I can do with this?
 
Upvote 0
Top