动作3 - Sound.extract方法清空声音对象数据 [英] Actionscript 3 - Sound.extract method empties sound object data

查看:165
本文介绍了动作3 - Sound.extract方法清空声音对象数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用下面的提取Sound对象的字节信息 - 但是如果我回到同一个声音对象,并再次运行此,则ByteArray没有可用的字节

  VAR数据:ByteArray的=新的ByteArray;
sound.extract(数据,sound.length * 44.1);
data.position = 0;
返回的数据;
 

这是正确的行为? 有没有办法做到这一点多次相同的声音对象?还是我在这里做得不对。任何帮助AP preciated - 谢谢

解决方案

  sound.extract(数据,sound.length * 44.1,-1);
 

也许你需要使用-1设置指定startPosition。 否则,当你回到相同的声音,并再次呼吁提取物,该startpositon不会是-1。

I am using the following to extract the byte info from a sound object - however if I go back to the same sound object and run this again, The byteArray has no bytes available.

var data:ByteArray = new ByteArray;
sound.extract(data,sound.length*44.1);
data.position = 0;
return data;

Is this the correct behavior? Is there not a way to do this multiple times on the same sound object? Or am I doing something wrong here. Any help appreciated - thanks

解决方案

sound.extract(data,sound.length*44.1, -1);

Maybe you need to set the startPosition with -1. Otherwise when you go back to the same sound and call extract again, the startpositon will not be -1.

这篇关于动作3 - Sound.extract方法清空声音对象数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆