apps4av / avare

Avare Aviation GPS for Android
Other
148 stars 120 forks source link

Adding audible traffic alerts feature #473

Closed shanelenagh closed 1 year ago

shanelenagh commented 1 year ago

This is an initial implementation of an audible ADSB traffic alerts feature. It includes base announcement of relative clock-position (+high/level/low) of traffic within a configured radius, as well as optional Time to Closest Point of Approach (TCPA) feature, also configurable with a "closest" distance and time threshold before announcement is spoken. There is a recently added "max alert frequency" feature to prevent the alerts from being too chatty/repetitive with announcing the same traffic (by ADSB callsign) repeatedly. I intend to do a nice Venn diagram for the base audible alerts announcements vs. the more specific TCPA closing alerts vs. the even more specific sawtooth double-chirp when the TCPA is within a configured percentage.

From a technical perspective, the individual audio files (mono MP3's, with my voice for now, haha) are played by a sequential audio player using the Android SoundPool mechanism for fast in-memory audio playbook, most commonly used in games. I also run the alert processor in a separate thread, to keep the UI from lagging due to this feature. Memory management and GC tests have been conducted to ensure reasonable feature memory usage and appropriate GC of objects, but there is always more that could be optimized there, no doubt.

apps4av commented 1 year ago

Tested and seems to be working well. Some issues: Keep getting ownship notifications. Cannot disable audio notifications. Even though, disabled in Preferences, still getting audible alerts. This happens on a fresh install.

shanelenagh commented 1 year ago

The changes seem quite straightforward. Whats the copyright for the mp3 files included ?

Yeah, I really don't care about those. If you want something written saying I assigned copyright to you that's fine. Nothing special in those recordings, haha. I actually thought about doing them all the way up to 60 seconds, and I have the Audacity recording that has that, but SoundPool loads all of those into memory uncompressed, so I didn't want to bloat the memory size of the feature too much.

apps4av commented 1 year ago

Was asking if the files are entirely yours or if you copied them from somewhere. If you made them then it's fine. The PR is merged to master with some adjustments.

On Sat, Sep 24, 2022, 10:40 AM shanelenagh @.***> wrote:

The changes seem quite straightforward. Whats the copyright for the mp3 files included ?

Yeah, I really don't care about those. If you want something written saying I assigned copyright to you that's fine. Nothing special in those recordings, haha. I actually thought about doing them all the way up to 60 seconds, and I have the Audacity recording that has that, but SoundPool loads all of those into memory uncompressed, so I didn't want to bloat the memory size of the feature too much.

— Reply to this email directly, view it on GitHub https://github.com/apps4av/avare/pull/473#issuecomment-1256985644, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAWPRT6YDG4WQWD2S3WLEC3V74HHFANCNFSM6AAAAAAQRTE7WI . You are receiving this because you modified the open/close state.Message ID: @.***>

shanelenagh commented 1 year ago

The voice files are all my voice, yes, and I recorded them with Audacity and a Blue Snowball mic--nothing fancy. The sawtooth double chirp I also created with Audacity, using their chirp plug-in with parameters I set.

On Tue, Oct 11, 2022, 02:05 Zubair Khan @.***> wrote:

Was asking if the files are entirely yours or if you copied them from somewhere. If you made them then it's fine. The PR is merged to master with some adjustments.

On Sat, Sep 24, 2022, 10:40 AM shanelenagh @.***> wrote:

The changes seem quite straightforward. Whats the copyright for the mp3 files included ?

Yeah, I really don't care about those. If you want something written saying I assigned copyright to you that's fine. Nothing special in those recordings, haha. I actually thought about doing them all the way up to 60 seconds, and I have the Audacity recording that has that, but SoundPool loads all of those into memory uncompressed, so I didn't want to bloat the memory size of the feature too much.

— Reply to this email directly, view it on GitHub https://github.com/apps4av/avare/pull/473#issuecomment-1256985644, or unsubscribe < https://github.com/notifications/unsubscribe-auth/AAWPRT6YDG4WQWD2S3WLEC3V74HHFANCNFSM6AAAAAAQRTE7WI

. You are receiving this because you modified the open/close state.Message ID: @.***>

— Reply to this email directly, view it on GitHub https://github.com/apps4av/avare/pull/473#issuecomment-1274183947, or unsubscribe https://github.com/notifications/unsubscribe-auth/AB6536KTZQSYLWEMA3S65DDWCUGURANCNFSM6AAAAAAQRTE7WI . You are receiving this because you authored the thread.Message ID: @.***>