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

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

问题描述

我正在使用以下内容从声音对象中提取字节信息 - 但是,如果我回到同一个声音对象并再次运行它,则 byteArray 没有可用字节.

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);

也许您需要将 startPosition 设置为 -1.否则当你回到同一个声音并再次调用extract时,startpositon不会是-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.

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

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