fix(EnglishCpVPhonemizer): assign this.singer before ReadDictionaryAndInit#2060
Open
yaaayaaa wants to merge 1 commit intostakira:masterfrom
Open
fix(EnglishCpVPhonemizer): assign this.singer before ReadDictionaryAndInit#2060yaaayaaa wants to merge 1 commit intostakira:masterfrom
yaaayaaa wants to merge 1 commit intostakira:masterfrom
Conversation
ReadDictionaryAndInit calls LoadBaseDictionary which references singer.Found. Without the assignment first, the init-time NPE is caught silently by ReadDictionary and the phonemizer's dictionary stays null, causing Process to return [""] for every input. Symptom: EnglishCpVPhonemizer returns empty phoneme lists in any environment where SetSinger is called before the first Process.
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.
Problem
EnglishCpVPhonemizer.SetSinger()callsReadDictionaryAndInit()beforeassigning
this.singer.ReadDictionaryAndInit()loads the base dictionarywhich references
singer.Found— aNullReferenceExceptionis thrown,caught silently inside
ReadDictionary, leavingdictnull.Subsequent
Process()calls then return a single empty-string phonemefor every input.
Repro
Build
OpenUtau.Testand run:Fix
Swap the two lines in
SetSingersothis.singeris set before init.Impact
Makes
EnglishCpVPhonemizeractually work in headless test environmentsand any scenario where
ReadDictionaryAndInitruns before a realProcess.Discovered during conformance testing against an en_liee voicebank.
Prior to this fix, tests had to use a reflection workaround to set
this.singerbefore invokingSetSinger.