2011-04-02 86 views

回答

8

您可以将相同的样本多次写入输出缓冲区。

function downOctave(bytes:ByteArray):ByteArray 
     { 
      var returnBytes:ByteArray = new ByteArray(); 
      bytes.position = 0; 
      while(bytes.bytesAvailable > 0) 
      { 
       returnBytes.writeFloat(bytes.readFloat()); 
       returnBytes.writeFloat(bytes.readFloat()); 
       bytes.position -= 8; 
       returnBytes.writeFloat(bytes.readFloat()); 
       returnBytes.writeFloat(bytes.readFloat()); 

      } 
      return returnBytes; 
     } 

这音高移位是非常简单和快速的和适用于闪光实时使用,但它确实改变在该声音正在播放的速度。对于不改变持续时间的音高转换,您需要使用基于傅立叶变换的方法。 Like this guy did here.

+0

这就是我所需要的,不能够感谢你! – DLiKS 2011-04-02 19:30:40