Pay for Hesitation: [API Bug] Differences between Sound.length and SoundChannel.position in ActionScript 3
Pay for Hesitation
Ideas are Worthless Unless Acted Upon
Pages
Home
Authors
2010年11月2日 星期二
[API Bug] Differences between Sound.length and SoundChannel.position in ActionScript 3
Bug with Sound channel position and mp3s less than 128kbps
Differences between Sound.length and SoundChannel.position in ActionScript 3
soundchannel.position 和 sound.length有误差
//There is a known issue that channel.position may never get to sound.length when the bitrate of a MP3 file is less than 128kbps
public function isEndOfSound( index:int ):Boolean
{
if( _soundTable[ index ] == null)
{
throw new Error( "Sound: " + index + " does not exist!");
}else
{
var sound:Sound = _soundTable[ index ] as Sound;
var channel:SoundChannel = _soundChannelTable[ index ] as SoundChannel;
if( channel.position == sound.length)
{
return true;
}else{
trace("position:", channel.position, " length: ", sound.length);
return false;
}
}
}
沒有留言:
張貼留言
較新的文章
較舊的文章
首頁
訂閱:
張貼留言 (Atom)
沒有留言:
張貼留言