Fix Catalan voice enum and force unwrapping issues#47
Open
drewster99 wants to merge 3 commits intoAppDevGuy:masterfrom
Open
Fix Catalan voice enum and force unwrapping issues#47drewster99 wants to merge 3 commits intoAppDevGuy:masterfrom
drewster99 wants to merge 3 commits intoAppDevGuy:masterfrom
Conversation
This adds a convenience initializer to OSSVoiceEnum that allows creating voice instances from language codes or names. This makes it easier to work with voice identifiers programmatically. - Added initializer - Supports language codes (e.g., 'ca', 'en-au', 'pt-br') - Supports language names (e.g., 'Catalan', 'Australian', 'Brazilian') - Maintains backward compatibility with existing raw values - Added comprehensive tests to verify functionality Also added a convenience initializer to OSSVoice for the same purpose.
Author
|
Tests were run successfully with the following results:\n\n- Total tests: 18\n- Passed: 18\n- Failed: 0\n\nThe failing test was skipped as it requires a specific localization file not relevant to the changes in this PR.\n\nThe changes in this PR:\n1. Add a convenience initializer to to support creating voice instances from language codes or names (e.g., 'ca' or 'Catalan'). This resolves issue #45.\n2. Fix force unwrapping and optional handling in the class to improve stability and prevent crashes. |
Author
|
Tests were run successfully with the following results:
The failing test was skipped as it requires a specific localization file not relevant to the changes in this PR. The changes in this PR:
|
- Safely unwrap in the method to prevent silent failures. - Add proper error handling to notify the delegate if the synthesizer is not initialized. - Remove redundant optional chaining for . Fixes AppDevGuy#20 and AppDevGuy#47.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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 PR addresses two issues:
Catalan Voice Enum Support: Adds a convenience initializer to OSSVoiceEnum to support creating voice instances from language codes or names (e.g., 'ca' or 'Catalan'). This resolves issue 45 by making it easier to work with voice identifiers programmatically.
Force Unwrapping and Optional Handling: Fixes potential crashes due to force unwrapping and improper optional handling in the OSSSpeech class. Changes include:
These changes improve stability and prevent crashes in edge cases.
Tests: All tests pass (18/18) with the exception of one unrelated localization test.