Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

xml output for #say miss xml header #644

Open
KrionHY opened this issue Aug 6, 2019 · 4 comments
Open

xml output for #say miss xml header #644

KrionHY opened this issue Aug 6, 2019 · 4 comments

Comments

@KrionHY
Copy link

KrionHY commented Aug 6, 2019

I use adhearsion with asterisk/UniMRCP. when I call #say function, the xml content sent to asterisk miss xml header. here is out from log:

[2019-08-06 17:13:13.882] DEBUG Adhearsion::Call: b84e7088-655b-4763-a6e5-fb37c60391bb@: Executing command #<Punchblock::Component::Output target_call_id=nil, target_mixer_name=nil, component_id=nil, source_uri=nil, domain=nil, transport=nil, timestamp=Tue, 06 Aug 2019 17:13:13 +0800, request_id="cc7e2e15-b2d2-4e72-ac82-051393063bd4", headers={}, voice=nil, interrupt_on=nil, start_offset=nil, start_paused=nil, repeat_interval=nil, repeat_times=nil, max_time=nil, renderer="unimrcp", render_documents=[#<Punchblock::Component::Output::Document target_call_id=nil, target_mixer_name=nil, component_id=nil, source_uri=nil, domain=nil, transport=nil, timestamp=Tue, 06 Aug 2019 17:13:13 +0800, url=nil, content_type="application/ssml+xml", value=<speak xmlns="http://www.w3.org/2001/10/synthesis" version="1.0" xml:lang="en-US">&#x4F60;&#x597D;&#xFF0C;&#x5927;&#x5BB6;&#x597D;</speak>>]>

I miss something, or is that a bug?

OS: MAC OS

@benlangfeld
Copy link
Member

And then what happens? Does it break? What do you see in Asterisk logs?

@KrionHY
Copy link
Author

KrionHY commented Aug 6, 2019

Asterisk didn't log any errors, and foward the xml content to UniMRCP server, but my TTS provider (https://ai.baidu.com/docs#/BSIC-MRCP/top) get the xml content which miss xml header as plain text, and synthesize whole xml content to speech.

@bklang
Copy link
Member

bklang commented Aug 6, 2019

By "XML Header", can you be more specific what you are referring to? This sounds more like a configuration problem between UniMRCP and Baidu, rather than something in Adhearsion. Can you get UniMRCP to work from extensions.conf to verify that Asterisk is configured correctly?

@KrionHY
Copy link
Author

KrionHY commented Aug 6, 2019

I'm sorry about my terrible English. I try to describe this issue more clearly.

Yes, UniMRCP can work with Asterisk from extensions.conf.

the xml content from Adhearsion will be forward to Asterisk, and Asterisk forward to UniMRCP/ Baidu.

Baidu expect the xml content following MRCP protocol like:
08-07 00:58:33:118 [baidu/speech-arch/open-mrcp-tts/tts_channel.cpp:439][tts_channel_t::push_request_msg][logid:6c276be2b86b11e9_0] send TTS request msg: {"text":"<?xml version=\"1.0\" ?>\n<speak>\nHello World\n</speak>\n","per":100,"vol":5,"xml":1,"aue":5,"rate":0,"pit":5,"spd":5,"user_sn":"6c276be2b86b11e9_0","lan":"en_US"}

but the xml content from Adhearsion like:
08-07 01:14:42:349 [baidu/speech-arch/open-mrcp-tts/tts_channel.cpp:439][tts_channel_t::push_request_msg][logid:adf7b962b86d11e9_0] send TTS request msg: {"text":"<speak xmlns=\"http://www.w3.org/2001/10/synthesis\" version=\"1.0\" xml:lang=\"en-US\">Hello World</speak>","per":100,"vol":5,"xml":1,"aue":5,"rate":0,"pit":5,"spd":5,"user_sn":"adf7b962b86d11e9_0","lan":"en_US"}

The text value miss the xml header:
<?xml version="1.0" ?>

Baidu synthesize whole text value to speech, rather than Hello World string .

The text value is from Adhearsion:
[2019-08-06 17:13:13.882] DEBUG Adhearsion::Call: b84e7088-655b-4763-a6e5-fb37c60391bb@: Executing command #<Punchblock::Component::Output target_call_id=nil, target_mixer_name=nil, component_id=nil, source_uri=nil, domain=nil, transport=nil, timestamp=Tue, 06 Aug 2019 17:13:13 +0800, request_id="cc7e2e15-b2d2-4e72-ac82-051393063bd4", headers={}, voice=nil, interrupt_on=nil, start_offset=nil, start_paused=nil, repeat_interval=nil, repeat_times=nil, max_time=nil, renderer="unimrcp", render_documents=[#<Punchblock::Component::Output::Document target_call_id=nil, target_mixer_name=nil, component_id=nil, source_uri=nil, domain=nil, transport=nil, timestamp=Tue, 06 Aug 2019 17:13:13 +0800, url=nil, content_type="application/ssml+xml", value=<speak xmlns="http://www.w3.org/2001/10/synthesis" version="1.0" xml:lang="en-US">Hello World</speak>>]>

So, I think the issue has three causes:
1, Do Adhearsion miss to send xml header?
2, Should Asterisk add the xml header?
3, Baidu handle the text value incorrectly.

which cause I should to follow?

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants