Closed aynader closed 8 months ago
@aynader can you provide me with some example text please?
sure!
"أنا مش عارفني، أنا تهت مني، أنا مش أنا"
"لا دي ملامحي ولا شكلي، شكلي ولا دا أنا"
"أبص لروحي فجأة لقيتني"
"لقيتني كبرت، فجأة كبرت"
"تعبت من المفاجأة ونزلت دمعتي"
"قولي لي إيه يا مرايتي"
"قولي لي إيه حكايتي تكونشي"
"تكونشي دي نهايتي، وآخر قصتي"
I just figured it out. You just need to update this, in TextToSpeechEndpoint.cs :
var request = new TextToSpeechRequest(text, model, defaultVoiceSettings);
to:
byte[] utf8Bytes = Encoding.UTF8.GetBytes(text);
string encodedText = Encoding.UTF8.GetString(utf8Bytes);
var request = new TextToSpeechRequest(encodedText, model, defaultVoiceSettings);
I tested it and it works flawlessly.
I wouldn't necessarily consider this a bug with the library itself, but good to know that text may need to be reencoded before sending.
I'll keep this open a bit longer as I do more research on what to do for next steps.
Latest version gives you more power to specify encoding if needed. Tested this out and seemed to work ok, but would like validation with native speaker.
It appears that the API doesn't encode Arabic correctly, Arabic text generated through the API is 'distorted' while Arabic text generated on the website, works as intended.