367
Views
0
Helpful
0
Comments

Options
- Subscribe to RSS Feed
- Mark as New
- Mark as Read
- Bookmark
- Subscribe
- Printer Friendly Page
- Report Inappropriate Content
on 01-24-2014 11:05 AM
This document was generated from CDN thread
Created by: null on 07-09-2006 09:13:25 PM
Hi,
I am developing a custom audio element. The element takes gender and the language as configurable parameters and puts the SSML tag like <voice gender="female">TTS Text </voice> around the TTS text.
With VAudio.getTranscript(index) method, I can access the TTS text specified. I need to reset the text. Otherwise, when the code is generated, the TTS text is generated twice. Once with SSML and duplicate text from the element I guess.
VAudio.add("<voice gender=\"female\">", VAudio.SSML);
VAudio.add(VAudio.getTranscript(index), VAudio.SSML);
VAudio.add("</voice>", VAudio.SSML);
Is there any other method to enclose SSML tags around the TTS text ? I do not want to put the SSML tags in the TTS textbox. I want to control in my custom audio element
Thanks - Bhaskar
Subject: RE: How to add SSML tags around TTS text in the custom audio element playAu
Replied by: Vance Vagell on 21-09-2006 08:45:44 PM
Hi Bhaskar,
Could you please explain what you mean by "the TTS text is generated twice"? Do you hear the same text twice when you call in, or are you seeing it appear twice in the VoiceXML? Please provide some additional detail here so that we understand where this duplicate text is appearing. If there is VoiceXML that demonstrates it, please attach it to this post.
Also, is your element extending one of the built-in elements? If so, does it call the superclass's addXmlBody() method after your own code? That could potentially result in another set of audio, if you've already created it at that point.
However, in general your approach is a sound one. It makes sense to allow these to be configurable options (if you need these tags regularly) and then add the required SSML programatically.
Regards,
Vance
Subject: See attached VXML code
Replied by: null on 21-09-2006 09:43:44 PM
Attached is the custom audio element source code. Below is the VXML code audium generated for the audio element. If you look in the <prompt> block, you will see the text printed twice. Once with SSML tags and once without.
<xml>
<assign>
<goto>
</block>
</form>
Welcome to My audio element
<voice>Welcome to My audio element</voice>
</prompt>[/b:25fbac5eaf] [/color:25fbac5eaf] <assign>
<submit next="/CVP/Server" method="post" namelist="audium_vxmlLog dummy">
</block>
</form>
</vxml>[code:1:25fbac5eaf][/code:1:25fbac5eaf][code:1:25fbac5eaf][/code:1:25fbac5eaf][code:1:25fbac5eaf][/code:1:25fbac5eaf][/color:25fbac5eaf]
Subject: RE: See attached VXML code
Replied by: Michael Bochynski on 03-10-2006 09:28:57 PM
Hi Bhaskar,
We have reviewed your code and noticed the following:
1. You create the VAudio object here:
[code:1:9c7ee46f90] VAudio audio = audioGroup.constructAudio(ved); [/code:1:9c7ee46f90]
2. then you have the following line, where you add another audio with the appropriate SSML tag:
[code:1:9c7ee46f90] audio.add("<voice>" + audio.getTranscript(0) + "</voice>", VAudio.SSML); [/code:1:9c7ee46f90]
3. later you add the created audio to the VBlock object:
[code:1:9c7ee46f90] block.add(audio); [/code:1:9c7ee46f90]
Note that in the #1 step you create the VAudio item, with all the Substitution and SIS parsing and then in the step #2 you add another audio with new TTS, this time with SSML to the same object. Hence, you have the same TTS text twice, once created at #1 and then added with SSML tags in the #2. Note that per Javadocs, [i:9c7ee46f90] add [/i:9c7ee46f90] method adds another TTS.
Hence we would suggest tweaking the code slightly to accommodate your needs. We suggest using the [i:9c7ee46f90] constructAudio(ved) [/i:9c7ee46f90] method, since it handles all the Substitution and SIS plugins used in the audio group for you. However, instead of adding this VAudio object, you should create another object, with the same properties, but with the SSML tags added. Then, instead of adding the original VAudio object, you would add the newly created VAudio object to your code. The only modification required would be in the step #2. Here is the sample code illustrating this approach:
1. Create the VAudio object based on the main settings:
[code:1:9c7ee46f90] VAudio audio = audioGroup.constructAudio(ved); [/code:1:9c7ee46f90]
2. create a new VAudio object, iterate over all items in the old audio and add SSML tags to the TTS text
[code:1:9c7ee46f90]
VAudio newAudioWithSSML = VAudio.getNew(pref);
for (int i = 0; i < audio.getNumParts(); i++) {
String originalTranscript = audio.getTranscript(i);
newAudioWithSSML.add(audio.getPath(i), audio.getFilename(i),
"<voice>" + originalTranscript + "</voice>", audio.getFormat(i), true);
}
[/code:1:9c7ee46f90]
3. add the new created audio to the VBlock object:
[code:1:9c7ee46f90] block.add(newAudioWithSSML); [/code:1:9c7ee46f90]
Note that the [i:9c7ee46f90] audio [/i:9c7ee46f90] object, created in the #1 step is not added to the VXML. Additionally, in #2 step all the properties for the audio item are maintained as set in Studio by a developer.
Moreover, while testing your class we noticed that call cannot proceed to the second step. Please double check that you can go to the second VoiceXML page generated and there are no other errors in your code.
Hope it helps,
Michael
Created by: null on 07-09-2006 09:13:25 PM
Hi,
I am developing a custom audio element. The element takes gender and the language as configurable parameters and puts the SSML tag like <voice gender="female">TTS Text </voice> around the TTS text.
With VAudio.getTranscript(index) method, I can access the TTS text specified. I need to reset the text. Otherwise, when the code is generated, the TTS text is generated twice. Once with SSML and duplicate text from the element I guess.
VAudio.add("<voice gender=\"female\">", VAudio.SSML);
VAudio.add(VAudio.getTranscript(index), VAudio.SSML);
VAudio.add("</voice>", VAudio.SSML);
Is there any other method to enclose SSML tags around the TTS text ? I do not want to put the SSML tags in the TTS textbox. I want to control in my custom audio element
Thanks - Bhaskar
Subject: RE: How to add SSML tags around TTS text in the custom audio element playAu
Replied by: Vance Vagell on 21-09-2006 08:45:44 PM
Hi Bhaskar,
Could you please explain what you mean by "the TTS text is generated twice"? Do you hear the same text twice when you call in, or are you seeing it appear twice in the VoiceXML? Please provide some additional detail here so that we understand where this duplicate text is appearing. If there is VoiceXML that demonstrates it, please attach it to this post.
Also, is your element extending one of the built-in elements? If so, does it call the superclass's addXmlBody() method after your own code? That could potentially result in another set of audio, if you've already created it at that point.
However, in general your approach is a sound one. It makes sense to allow these to be configurable options (if you need these tags regularly) and then add the required SSML programatically.
Regards,
Vance
Subject: See attached VXML code
Replied by: null on 21-09-2006 09:43:44 PM
Attached is the custom audio element source code. Below is the VXML code audium generated for the audio element. If you look in the <prompt> block, you will see the text printed twice. Once with SSML tags and once without.
<xml>
- <vxml>
- <form id="audium_start_form">
- <block>
<assign>
<goto>
</block>
</form>
- <form id="start">
- <block>
Welcome to My audio element
<voice>Welcome to My audio element</voice>
</prompt>[/b:25fbac5eaf] [/color:25fbac5eaf] <assign>
<submit next="/CVP/Server" method="post" namelist="audium_vxmlLog dummy">
</block>
</form>
</vxml>[code:1:25fbac5eaf][/code:1:25fbac5eaf][code:1:25fbac5eaf][/code:1:25fbac5eaf][code:1:25fbac5eaf][/code:1:25fbac5eaf][/color:25fbac5eaf]
Subject: RE: See attached VXML code
Replied by: Michael Bochynski on 03-10-2006 09:28:57 PM
Hi Bhaskar,
We have reviewed your code and noticed the following:
1. You create the VAudio object here:
[code:1:9c7ee46f90] VAudio audio = audioGroup.constructAudio(ved); [/code:1:9c7ee46f90]
2. then you have the following line, where you add another audio with the appropriate SSML tag:
[code:1:9c7ee46f90] audio.add("<voice>" + audio.getTranscript(0) + "</voice>", VAudio.SSML); [/code:1:9c7ee46f90]
3. later you add the created audio to the VBlock object:
[code:1:9c7ee46f90] block.add(audio); [/code:1:9c7ee46f90]
Note that in the #1 step you create the VAudio item, with all the Substitution and SIS parsing and then in the step #2 you add another audio with new TTS, this time with SSML to the same object. Hence, you have the same TTS text twice, once created at #1 and then added with SSML tags in the #2. Note that per Javadocs, [i:9c7ee46f90] add [/i:9c7ee46f90] method adds another TTS.
Hence we would suggest tweaking the code slightly to accommodate your needs. We suggest using the [i:9c7ee46f90] constructAudio(ved) [/i:9c7ee46f90] method, since it handles all the Substitution and SIS plugins used in the audio group for you. However, instead of adding this VAudio object, you should create another object, with the same properties, but with the SSML tags added. Then, instead of adding the original VAudio object, you would add the newly created VAudio object to your code. The only modification required would be in the step #2. Here is the sample code illustrating this approach:
1. Create the VAudio object based on the main settings:
[code:1:9c7ee46f90] VAudio audio = audioGroup.constructAudio(ved); [/code:1:9c7ee46f90]
2. create a new VAudio object, iterate over all items in the old audio and add SSML tags to the TTS text
[code:1:9c7ee46f90]
VAudio newAudioWithSSML = VAudio.getNew(pref);
for (int i = 0; i < audio.getNumParts(); i++) {
String originalTranscript = audio.getTranscript(i);
newAudioWithSSML.add(audio.getPath(i), audio.getFilename(i),
"<voice>" + originalTranscript + "</voice>", audio.getFormat(i), true);
}
[/code:1:9c7ee46f90]
3. add the new created audio to the VBlock object:
[code:1:9c7ee46f90] block.add(newAudioWithSSML); [/code:1:9c7ee46f90]
Note that the [i:9c7ee46f90] audio [/i:9c7ee46f90] object, created in the #1 step is not added to the VXML. Additionally, in #2 step all the properties for the audio item are maintained as set in Studio by a developer.
Moreover, while testing your class we noticed that call cannot proceed to the second step. Please double check that you can go to the second VoiceXML page generated and there are no other errors in your code.
Hope it helps,
Michael
Labels: