Skip to main content

Voice packages

🚧 This article is incomplete

This article is incomplete & needs to be reviewed. You can help by creating a pull request.

OsmAnd supports two types of voice packages:

If you could not find the voice package you need, please follow the following examples and create your own voice package. Examples - https://github.com/osmandapp/OsmAnd-resources/tree/master/voice, German package de_0.voice.zip, English package en_0.voice.zip.

Difference between TTS and Recorded packages

  • a Text-To-Speech engine supports Street Name, Refs, POI names pronouncation
  • all Text-To-Speech supported packages bundled and updated with an application
  • a Recorded Package needs to be installed and updated manually (although the configuration file could be updated with app update)
  • a Recorded Package may not support some correct forms, and support is limited
  • a Recorded Package does not require any proprietary TTS engine to be installed

Package Structure

Voice package usually is distributed as .voice.zip, where the zip contains one folder with lang_tts.js (main configuration file), and sound files if they are present.

The configuration files are written in JavaScript language. All configuration files are by default TTS-packages, even if there is no TTS present yet to support the language. And later the configuration is extended by mapping 'dictionary phrases' to 'recorded file names'.

function populateDictionary(tts) {
// ROUTE CALCULATED
dictionary["route_is1"] = tts ? "Die berechnete Strecke ist" : "route_is1.ogg";
dictionary["route_is2"] = tts ? "lang" : "route_is2.ogg";
dictionary["route_calculate"] = tts ? "Route neu berechnet" : "route_calculate.ogg";
dictionary["distance"] = tts ? "die Entfernung beträgt" : "distance.ogg";

// LEFT/RIGHT
dictionary["prepare"] = tts ? "Demnächst " : "prepare.ogg"; // Demnächst sounds better then Vorbereiten zum
dictionary["after"] = tts ? "nach" : "after.ogg";

dictionary["left"] = tts ? "links abbiegen" : "left.ogg";
.....
}

function route_recalc(dist, seconds) {
return dictionary["route_calculate"] + (tts ? ", " : " ") + distance(dist, "nominativ") + (tts ? ", " : " ") + dictionary["time"] + " " + time(seconds) + (tts ? ". " : " ");
}

Generation custom package

Please check the project resources and use the same folder structure as the German package - simply make copy. Once it's done you can change, run the generation script and specify the required arguments. Help is inside the script.

Testing voice package (Android)

For testing it is possible to use :

  • the Navigation
  • the Navigation simulation,
  • or the handy version of OsmAnd development plugin, which simulates different voice commands to be tested.