ayiaq1 发表于 2016-6-12 10:20:15

AS3,百度语音识别,返回数据问题

使用的是百度语音识别API地址:http://yuyin.baidu.com/docs/tts/136

返回数据格式 百度回复是mp3,但是我转为bytes为null,

返回格式如下:




文件在:UIManager.as
附件:


破晓 发表于 2016-6-12 12:57:16

uploader = new URLStream();

private function onUploadCompleteHandler(e:Event):void
                {       
                        var bytes:ByteArray = new ByteArray();
            uploader.readBytes(bytes);
                //        sound.extract(by, by.length);
            sound = new Sound();
                        sound.loadCompressedDataFromByteArray(bytes, bytes.length);
                        soundChannel = sound.play(0,999);
                        _soundTransform = new SoundTransform();
                        soundChannel.soundTransform = _soundTransform;       
                }

破晓 发表于 2016-6-12 13:35:25

URLStream 也行不过要把 dataFormat   改成二进制
页: [1]
查看完整版本: AS3,百度语音识别,返回数据问题