Sound.hx 1.4 KB

12345678910111213141516171819202122232425
  1. package flash.media;
  2. extern class Sound extends flash.events.EventDispatcher {
  3. @:flash.property var bytesLoaded(get,never) : UInt;
  4. @:flash.property var bytesTotal(get,never) : Int;
  5. @:flash.property var id3(get,never) : ID3Info;
  6. @:flash.property var isBuffering(get,never) : Bool;
  7. @:flash.property @:require(flash10_1) var isURLInaccessible(get,never) : Bool;
  8. @:flash.property var length(get,never) : Float;
  9. @:flash.property var url(get,never) : String;
  10. function new(?stream : flash.net.URLRequest, ?context : SoundLoaderContext) : Void;
  11. function close() : Void;
  12. @:require(flash10) function extract(target : flash.utils.ByteArray, length : Float, startPosition : Float = -1) : Float;
  13. private function get_bytesLoaded() : UInt;
  14. private function get_bytesTotal() : Int;
  15. private function get_id3() : ID3Info;
  16. private function get_isBuffering() : Bool;
  17. private function get_isURLInaccessible() : Bool;
  18. private function get_length() : Float;
  19. private function get_url() : String;
  20. function load(stream : flash.net.URLRequest, ?context : SoundLoaderContext) : Void;
  21. @:require(flash11) function loadCompressedDataFromByteArray(bytes : flash.utils.ByteArray, bytesLength : UInt) : Void;
  22. @:require(flash11) function loadPCMFromByteArray(bytes : flash.utils.ByteArray, samples : UInt, ?format : String, stereo : Bool = true, sampleRate : Float = 44100) : Void;
  23. function play(startTime : Float = 0, loops : Int = 0, ?sndTransform : SoundTransform) : SoundChannel;
  24. }