可以正常播放了,组合的的时候每段数据流的前5个字符和结尾的一个字符丢掉,合并声音就对了。我是把异步生成,和实时生成的数据对比,发现每段的数据流丢掉前5后1就,数据就一样了。我想知道阿里语音AI中每段数据流的前五个字符是什么意思,代表的进度还是长度还是什么?
{"payload":{"appkey":"wxZbIvDJQzZFKyBC","text":"雄盾电子设备有限公司主营智能床垫袋装床垫研发生产销售一体的企业现在抖音直播销售床垫主要采用分享床垫的知识用来吸引客户直接生成话术用于直播你的回复会直接用于生成直播","format":"mp3","sample_rate":16000,"speech_rate":0,"voice":"xiaoyun","volume":50,"pitch_rate":0},"header":{"appkey":"wxZbIvDJQzZFKyBC","message_id":"a52b3cba97213199589b7fbe92a045ec","task_id":"206a0986b9c5f4fb1e51689612973380","namespace":"SpeechSynthesizer","name":"StartSynthesis"}}
字节集:702{0,184,2,71,253,255,243,72,196,0,27,67,38,40,3,70,24,2,13,246,143,119,176,3,11,39,119,123,226,238,238,238,247,187,187,191,238,136,157,119,61,221,253,17,63,66,255,221,221,221,220,255,235,187,191,252,47,119,0,0,0,76,56,24,179,119,3,3,115,250,136,137,253,112,1,4,238,239,160,24,183,63,68,71,119,127,255,119,127,255,244,79,243,209,17,61,0,192,220,226,34,35,159,255,255,255,187,128,0,8,12,23,7,193,0,64,16,113,64,64,16,119,255,136,14,40,16,22,221,118,187,93,176,215,109,97,209,74,164,58,31,33,10,61,51,192,37,162,36,255,243,72,196,22,34,243,142,222,95,136,88,2,18,16,135,207,125,186,173,239,166,51,124,86,76,38,177,89,255,234,190,94,189,211,255,103,211,224,152,114,83,99,26,120,171,254,94,104,247,190,147,137,255,246,45,5,140,255,147,86,168,219,44,151,180,227,231,109,94,207,52,103,255,249,44,8,202,77,107,126,199,217,189,110,181,166,39,235,251,127,127,255,239,183,29,98,9,26,85,179,102,195,251,116,43,158,62,187,62,247,191,255,253,159,253,249,227,71,146,215,218,124,187,234,128,90,25,56,206,93,219,42,246,219,97,10,64,133,82,200,37,130,135,255,243,72,196,13,31,115,234,210,93,193,40,1,38,70,68,25,29,118,222,65,53,232,143,183,167,183,255,207,234,232,177,117,109,82,213,56,130,28,78,163,6,139,157,148,96,233,50,114,94,101,58,141,18,12,8,131,8,1,0,166,75,51,146,141,218,237,236,187,157,152,208,212,65,68,19,48,226,16,172,170,200,123,165,179,19,217,103,118,40,193,0,16,58,236,19,22,66,156,170,241,131,93,88,73,245,69,69,125,103,43,15,117,23,14,34,138,12,81,65,37,29,2,72,125,85,190,219,100,154,218,201,32,255,14,198,49,10,86,125,34,109,134,236,255,243,72,196,18,32,227,106,222,90,96,203,50,225,56,241,135,215,124,113,188,197,105,235,233,94,212,69,195,21,128,213,243,196,88,46,48,96,174,103,177,150,128,202,4,103,53,138,28,41,151,254,135,124,34,183,110,46,83,153,174,225,144,80,89,36,125,18,223,111,88,137,74,56,32,7,150,117,86,161,94,141,111,255,20,67,138,12,24,203,139,33,39,42,216,88,80,147,59,60,139,178,15,36,227,70,210,166,247,115,89,234,99,137,133,83,34,237,99,17,113,51,128,49,49,62,149,181,54,156,146,218,137,8,129,154,15,89,159,167,225,194,100,78,255,243,72,196,17,31,3,222,226,90,121,132,214,69,143,224,63,219,202,170,31,238,171,98,1,175,44,251,205,172,198,72,8,252,18,90,164,38,70,35,150,47,101,210,218,100,37,172,248,246,49,52,191,95,114,108,123,49,93,10,97,99,11,32,99,145,76,232,174,143,100,158,212,90,162,4,25,136,114,182,223,244,182,157,124,67,186,24,166,42,104,245,77,106,223,210,239,151,86,188,227,58,114,47,215,86,178,255,109,14,139,122,74,178,130,21,48,194,181,146,0}
0,184,2,71,253,这个是字符的
第一个字符:表示当前分片的类型,常见的取值有:"A"表示音频数据,"T"表示文本数据。
第二到第五个字符:表示当前分片的序号,用于标识分片的顺序和连续性。
binary frame一般头部有2-6个字节
其中固定有2个字节,还有个masking-key,可能有0或者4个字节
我们这里暂时没有易语言的研发同学—此回答来自钉群“阿里语音AI【6群】”
语音合成服务返回的语音数据是一个二进制数据流,其中包含采样率、声道数、编码方式等语音参数信息。
这个二进制数据流的前几个字节很可能是这些参数信息,比如采样率、声道数等。
如果你观察到舍弃数据流前5个字节后,与实时合成得到的数据流相同,意味着这5个字节很可能就是包含参数信息的。
舍弃数据流最后1个字节可能是流的结束标志,告知数据已完成。
数据长度本身不一定影响数据效果,而是参数信息和采样率/声道确定了数据长度。
综上分析,我的理解是:
数据流的前5个字节很可能包含合成参数信息(采样率、声道等)
舍弃这5个字节后,后续的数据流就只包含有效音频数据
最后1个字节可能是流结束标志位
数据长度更多地由合成参数决定,并非前面提及的5个字节
阿里语音AI中每段数据流的前五个字符通常被称为音频流状态标识,用于表示音频流数据的状态和进度。
具体来说,这五个字符的含义如下:
"start":表示音频流的开始。
"cont":表示音频流的中间部分或连续部分。
"midst":表示音频流的中间部分,与"cont"类似。
"end":表示音频流的结束。
"last":表示音频流的最后一部分。
通过这些状态标识,可以在处理音频流时确定当前数据的位置、状态和进度。例如,在语音识别服务中,"start"表示音频流的起始部分,而"end"或"last"表示音频流的最后一部分,以便进行相应的识别操作。
版权声明:本文内容由阿里云实名注册用户自发贡献,版权归原作者所有,阿里云开发者社区不拥有其著作权,亦不承担相应法律责任。具体规则请查看《阿里云开发者社区用户服务协议》和《阿里云开发者社区知识产权保护指引》。如果您发现本社区中有涉嫌抄袭的内容,填写侵权投诉表单进行举报,一经查实,本社区将立刻删除涉嫌侵权内容。