Save proper external voice IDs in model files #1000
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is one possible fix for #999.
If merged, model files will now save the alert IDs from voice.ini/mp3 file names for custom alerts, instead of the internal index in voice_map.
To ensure old models are loaded correctly, an "mp3-" prefix is added to alert values saved in the new way (all models will be saved with new IDs).
This does have a side effect of making new model files incompatible with old firmware though. Alternatives would be to either not use a prefix and make it possible for old models to load with incorrect IDs when used with a poorly formatted voice.ini (probably not desirable) or use a prefix/suffix that atoi won't error out on (eg, "+" prefix), although that would make the file less readable without writing an explanation comment.