osmandapp / OsmAnd

OsmAnd
https://osmand.net
Other
4.64k stars 1.01k forks source link

Feature request: Beeps instead of announcements #10501

Closed DanielRykala closed 3 years ago

DanielRykala commented 3 years ago

Witajcie programisci osmand. Moja prosba do was dodajcie funkcje informowania sygnalem typu beep tak jak jest naprzyklad w garminie edge zamiast komend glosowych. Strasznie irytuje mnie jak telefon mowi w czasie jazdy na rowerze. Bardzo wam dziekuje za rozwiazanie problemu.

vshcherb commented 3 years ago

It's possible to add custom voice prompts (just edit existing) - https://docs.osmand.net/en/main@latest/development/contributing-to-osmand/voice-prompts

DanielRykala commented 3 years ago

Its possible in ios to?

Wysłane z iPhone'a

Wiadomość napisana przez vshcherb notifications@github.com w dniu 03.01.2021, o godz. 15:42:

 It's possible to add custom voice prompts (just edit existing) - https://docs.osmand.net/en/main@latest/development/contributing-to-osmand/voice-prompts

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe.

PaulStets commented 3 years ago

@DanielRykala Unfortunately, the iOS version does not support custom voice prompts yet.

sonora commented 3 years ago

Android: Very simple. I would need a nice, open license beep.ogg file we could use and a positive list which prompts you want to hear, then I can easily produce a beeps-only voice for us.

hctomio commented 3 years ago

+1 @sonora the site https://freesound.org/ has many sounds, including under CC0 license, such as: https://freesound.org/people/egomassive/sounds/536748/ https://freesound.org/people/Bonhomhongon/sounds/488355/ https://freesound.org/people/bay_area_bob/sounds/542042/ https://freesound.org/people/slappy13/sounds/151779/ https://freesound.org/people/lulyc/sounds/346116/ and many more...

mikehgentry commented 3 years ago

Google translate for the curious:

Hello osmand developers. My request to you, add the function of informing with a beep signal as it is for example in garmine edge instead of voice commands. It irritates me terribly when the phone speaks while cycling. Thank you very much for solving the problem.

I have a Garmin, and I always thought the beeps when navigating are a wasted opportunity - you could communicate a lot more information with simple codes, in different patterns and pitches. So for example:

This would be awesome on a bike!

edit: I think I'll have a go at this myself, doesn't look terribly difficult. But if someone more qualified wants to do it instead, please let me know to save duplicated effort. No idea on a timeline.

sonora commented 3 years ago

It's rather simple: Take a language file xx_tts.js, shorten the vocabulary portion to just use one (or several) beep.ogg files of your choice. Then in the command building section concatenate the beeps as needed, and set the rest to " ". Put everything in a (recorded type) voice folder like xx (without 'tts' in its name).

mikehgentry commented 3 years ago

Thanks! There are lots of functions in there that look like helper functions. I'm not sure if it'd be better for me to delete them entirely for the sake of neatness, or set them to return nothing in case they're ever called from outside that file. E.g. the "time(seconds)" function. I'm not too familiar with github, so searching is proving difficult. I suppose I could clone the repo, then search for for example "time(" using local tools, but if there's an easy answer that'd be appreciated!

For now I'll set them to return nothing, I suppose that's harmless.

sonora commented 3 years ago

I can review it if you want, just post your file and .oggs here (zipped).

To be on the safe side.return all functions either with your desired sequence of different "beep_xxx.ogg", or return " ", since the ones not explicitly called from within the file are called from the command builder and would likely cause an error if removed.

mikehgentry commented 3 years ago

I think this is in a good enough state for someone to test it, though I will keep tinkering with it - I'll let you know if I come up with anything that seems like a significant improvement. It's a little difficult getting the 'chattiness' level right, and I've tried to err on the side of quieter, but without outright missing any turns completely. Unfortunately this does seemingly result in it beeping sometimes when I'd rather it didn't (I think some of them are coming from 'bear left / right' instructions, which have always seemed to trigger a bit unpredictably).

I made the beeps using Audacity, and you can use them however you deem appropriate (I suppose that's cc0?)

beep.simple.zip

eta: I should clarify, I haven't even attempted to do the codes for left turn / right turn / exit no. etc. in this version, thought I'd make a very simple version that just beeps to get you to look at the screen, and work on a complex version afterwards.

sonora commented 3 years ago

I have renamed file and folder so that it will work out of the box now, see here:

Just extract to subfolder beep-simple of voice and it becomes select-able in OsmAnd.

HINT: If you enable OsmAnd's Development Plugin, it has a button "Test voice prompts", there you can go through all classes of prompts and see if the output is how you like it. Upon brief testing I guess there may be a few too many beeps in some situations to still to be useful, bit that's up for someone else to decide. ;)

mikehgentry commented 3 years ago

Thanks. I'll get rid of the 'bears' I reckon (I think I've confused them with the 'keeps'). Any other suggestions definitely welcome. I suppose it's always going to depend where you're riding - a system optimised for riding in a city probably isn't going to be perfect for riding country lanes. Hopefully we can settle on a few different designs, and get them to a commitable state - I don't think it'd be excessive having a few to choose from?

If anyone wants to have a go themselves, here are a selection of beeps (all cc0):

https://github.com/mikehgentry/OsmAnd-resources/tree/master/voice/beep-complex/voice

mikehgentry commented 3 years ago

I've tested this in the real world for a bit, and it seems to actually work pretty well. It would be nice to be able to get a consistent beep a given distance from the turning, which I don't think you can do at the moment. But absent that setting turn announcements to early seems to work - maybe it'd be better if the earliest available setting for turn announcements was much earlier...

If anyone wants to test them on the road (as opposed to just in the development plugin), I think you have to download one of the recorded voice packs in OsmAnd (I used Arabic, since it's at the top of the list and I don't speak Arabic). Then you can copy the files across to the right directory in /Android/Data/net.osmand.plus/files/voice, and rename the beep.js file so it replaces the one from the voice pack you've downloaded (so ar_tts.js in the case of Arabic). In navigation settings selecting the language you've overwritten should now get you the beeps.

The 'loud' versions just use square waves, which are easier to hear but harsher sounding, instead of sines. The 'simple' ones should be pretty self-explanatory. The 'complex' ones take a bit more getting used to. A long beep means do something now, and a short one means prepare. A low beep means left, and a high one means right. A sequence of N middle pitched ones means take the Nth exit. All three pitches means u-turn.

Any other bugs or suggestions welcome.

beep-loud-simple.zip beep-complex.zip beep-loud-complex.zip beep-simple.zip

[oops, sorry, wrong sound file in beep-simple.zip. Should be right now I think]

vshcherb commented 3 years ago

Please package it as export - https://github.com/osmandapp/OsmAnd/issues/12863. As we have fixed import of osf.zip files to OsmAnd

Packaged as Plugin (before importing delete zip in the end) beep.osf.zip

mikehgentry commented 3 years ago

@vshcherb Will try to figure this out tomorrow - thanks!

mikehgentry commented 3 years ago

I'm not having much luck with this. I tried installing the plugin you've provided using Settings -> Backup & Restore. It creates files in files/voice with seemingly appropriate names but no extension (e.g. beep-loud-complex). In logcat I can see complaints about not being able to find the oggs.

If on the other hand I just install the files I've got here (the oggs and the .js) in a directory in files/voice then restart OsmAnd and go into the navigation sound settings menu to select it, it appears for a few seconds, then disappears. Weirdly, if I select it before it disappears, it works fine!

System.err: lang_beep_loud_complex System : A resource failed to call release.

warnings appear in logcat around when it disappears. I can send you a full log by email if that's helpful (or post it here if someone can tell me if there's anything private I should redact first - I've figured out how to filter by pid, so it's only OsmAnd's output).

vshcherb commented 3 years ago

@mikehgentry it only works with latest version 4.1, so it's better to wait for release or use fresh nightly

scaidermern commented 2 years ago

Any plans to make these beep sounds an official feature? Some people find the usual voice announcements annoying.

mikehgentry commented 2 years ago

I haven't been out on the bike much over winter, but intend to repackage them properly (along with any improvements I've made) within the next month if that helps.

mikehgentry commented 2 years ago

Is this the preferred method of packaging them?

https://osmand.net/features/custom-package

And once done, should I just start another issue to publish them, or what?

edit: I tried putting the file in the voice directory, and it didn't recognise them. I could do the dance of downloading a different language and renaming things, but that surely isn't the right way to do it...

Thanks.

sonora commented 1 year ago

@vshcherb Is there a valid reason why we have never simply put the 4 beep packages provided above in our OsmAnd-resources repository and made them available for download in the app as recorded voices?

I guess the only challenge to solve is how to avoid these also showing up as TTS voices (they normally would)? They do of course not work if used via TTS.

mikehgentry commented 1 year ago

This is as far as I got with them.

beep-minimal.zip beep-simple.zip beep-simple-loud.zip beep-complex.zip beep-complex-loud.zip

I never quite figured out the mechanics of packaging them as a plugin (though it did work using the file vshcherb supplied above, I couldn't figure out how to add the minimal one). And I'm not completely happy with the behaviour of the simple ones on roundabouts (I prefer the complex ones so haven't really used them enough to come up with any good ideas).

sonora commented 1 year ago

In my mind, packaging them as a plugin is obsolete: I could simply unpack your zips and place them in our repository with the correct naming convention, and within 5 minutes they would become available in the app under "Downloads" for every user who looks there.

There are 2 questions in my mind about this:

  1. I am wondering if we do not overburden the user with choices here. Users will only see the voice "name", e.g. "beep-simple". I would feel better if we could arrvive at just one "beep" offering here, whichever you feel serves the best, and simply call it "beeps-only" or similar.
  2. This is more technical: Unless I am mistaken, while "beeps-xxx_tts.js" is the correct convention for naming our voice config files (both for TTS as well as for recorded voices), our server would interpret the presence of any such new config file also as a TTS voice (in addition to it being a recorded voice if it comes with ogg files). But, other than for conventional languages, these "beep" offerings are recorded-only, also offering these as TTS would be nonsense. @vshcherb may have an idea how to solve this.
mikehgentry commented 1 year ago

To my mind, loud is more or less strictly better than not loud (you can turn the phone volume down if needed, after all).

I suspect simple-loud is probably the most 'user-friendly' of the remaining three, so if you're only going to include one, that seems like the one to pick. But minimal has had a few requests in the linked issues, and as I said, I prefer complex-loud personally (takes a bit of getting used to, but is actually really useful then), so I think those three can be justified.

[edit - possibly with some tweaking. I have no idea how 'chatty' to make minimal, because it's not something I have any use for personally]

vshcherb commented 1 year ago

@sonora cause we didn't have scripts and we stopped supporting Voice package earlier than this were introduced, I think it's safe to add them to the server and see how it works

sonora commented 1 year ago

Ok, uoloaded. Looks like it works, so far they show up in the app's Download screen only as "Recorded voices". :)

sonora commented 1 year ago

PS: I now find these types of entries in the logcat:

12-01 10:03:41.407 27936  9229 W System.err: lang_beep_complex_loud
12-01 10:03:41.407 27936  9229 W System.err: lang_beep_complex
12-01 10:03:41.407 27936  9229 W System.err: lang_beep_complex_loud
12-01 10:03:41.407 27936  9229 W System.err: lang_beep_complex
12-01 10:03:41.408 27936  9229 W System.err: lang_beep_minimal
12-01 10:03:41.408 27936  9229 W System.err: lang_beep_complex_loud
12-01 10:03:41.408 27936  9229 W System.err: lang_beep_minimal
12-01 10:03:41.408 27936  9229 W System.err: lang_beep_simple_loud
12-01 10:03:41.408 27936  9229 W System.err: lang_beep_complex_loud
12-01 10:03:41.408 27936  9229 W System.err: lang_beep_simple_loud

I think this is because we have not defined the "beep-XXX" as a "language", and that may also be why they do not show up under TTS-languages, so it may be ok...(?)

vshcherb commented 1 year ago

to be honest not clear... needs to be found where this "error" emitted probably not an error

sonora commented 1 year ago

From here, I think: https://github.com/osmandapp/OsmAnd/blob/0100b306b9ddcbfecc60ad8dbfffb8a29d41c731/OsmAnd/src/net/osmand/plus/helpers/FileNameTranslationHelper.java#L121

We probably try to extract the language to initialize the TTS engine with. Could add some check if the extension we try to interpret as a "language" is actual not meant to be one, as in the "beep" cases, if we wanted to avoid this "error" being generated,

vshcherb commented 1 year ago

not that important or it could be checked before exception is created needs to be debugged in that case

mikehgentry commented 1 year ago

Should I write some brief documentation for this? If so, is it preferred as plain text which someone can edit into an appropriate article, or a PR (presumably for this: https://osmand.net/docs/user/navigation/guidance/voice-navigation )?

vshcherb commented 1 year ago

Yes, feel free to create PR https://osmand.net/docs/user/navigation/guidance/voice-navigation/ to