Closed alexobviously closed 2 days ago
The ssml with style parameter does not contain mstts:express-as
element. Thus, I doubt if style will work.
The ssml with style parameter does not contain
mstts:express-as
element. Thus, I doubt if style will work.
I actually tried mstts:express-as
first, and it didn't work. This solution does work, and you can test it with something like dart example/lib/example.dart -v en- -s shouting,whispering
(this will generate two audio files with different expressions for you to compare).
I don't fully understand every option in the SSML format and the (frankly weirdly structured) Azure API in general, but I believe the mstts
tags are for inline expressions, e.g. you want to generate a paragraph with default expression, and have a sentence in the middle with a different style. I could be wrong, but anyway the way I've implemented it here definitely does work.
I tried your ssml it does work. Also I was able to make this current ssml work with
mstts
tag and for your understanding in future this is how we can usemstts
tag in current ssml,"<speak version='1.0' " "xmlns='http://www.w3.org/2001/10/synthesis' " "xmlns:mstts='https://www.w3.org/2001/mstts' " "xml:lang='${voice.locale}'>" "<voice xml:lang='${voice.locale}' " "xml:gender='${voice.gender}' " "name='${voice.shortName}'>" "<prosody rate='$speed'>" "<mstts:express-as style='$style' styledegree='$styleDegree'>" "$text" "<\/mstts:express-as>" "<\/prosody><\/voice><\/speak>"
. Also you can addstyleDegree
in your current ssml it definitely helps in intensifying the style. If you can't, let me know I'll add that for you. 😄
Oh nice thanks, I didn't know about style degree!
I added a commit, it's supported now. Try something like example.dart -s excited -d 0.01,0.5,1.0,2.0
, it's pretty cool, and I definitely have a use for this in an app.
r.e. xml:
vs mstts
, I think I personally prefer the xml attribute method. In my opinion, it's a bit more concise and easier to read, and it has the same effect anyway. But I'll leave it up to @ghuyfel, I don't mind that much.
Yes will surely try.
Actually I also had a use for style and styleDegree and I was just about to raise PR for both this parameters but then I saw your PR so then I didn't but I had completed the code and all, What a co-incidence!
And yeah regarding xml:
vs mstts
I don't mind any of them as long as it works.
It would be great to get this merged
Hi David, I have been very busy recently, I will have a look at the PR over the weekend. Thanks for the support
From: David Dikman @.> Sent: Wednesday, November 20, 2024 11:22:22 PM To: ghuyfel/flutter_azure_tts @.> Cc: Fel @.>; Mention @.> Subject: Re: [ghuyfel/flutter_azure_tts] Support for styles and roles (PR #19)
It would be great to get this merged
— Reply to this email directly, view it on GitHubhttps://github.com/ghuyfel/flutter_azure_tts/pull/19#issuecomment-2489566332, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AAZ7RDZ67WIMJACJI73MS632BT4Q5AVCNFSM6AAAAABSFQNPXCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDIOBZGU3DMMZTGI. You are receiving this because you were mentioned.Message ID: @.***>
@ghuyfel no worries, sorry to rush :) I ended up doing a tiny version of this directly in our code base instead, so don't feel any pressure!
Thanks a lot @alexobviously, well done
VoiceModel
includesstyles
androles
fields, corresponding toStyleList
andRolePlayList
in the API response, respectively.TtsParams
accepts optionalstyle
,styleDegree
androle
parameters.build_runner
was having conflicts and it needs to be done eventually anyway).example/lib/example.dart
). The existing example is still there undermain.dart
. Feel free to rename.I suggest making this part of
0.2.0
because the SDK constraint has changed.