Archive for May, 2009

Хелп, а хелп, что такое startPosition в sound.extract?

Thursday, May 7th, 2009

startPosition:Number (default = -1) — The sample at which extraction begins. If you don’t specify a value, the first call to Sound.extract() starts at the beginning of the sound; subsequent calls without a value for startPosition progress sequentially through the file. - был ответ.

По мне так нифига не понятно.
И лишь метод научного тыка рассказал мне как с этим работать:

var EXTRACT : Number = 1024;
var snd:Sound = new Sound(new URLRequest("1.mp3"));
var ch:SoundChannel = snd.play();
var bytes : ByteArray = new ByteArray();
snd.extract(bytes, EXTRACT,(ch.position)*44.1);