README.txt 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118
  1. WavPlayer -- flash player for asterisk
  2. * Note: Use Haxe-2 to compile.
  3. WavPlayer is flash player, designed to play files, recorded for and
  4. by Asterisk (www.asterisk.org) or any other telephone system.
  5. If supports playback of:
  6. Format | Codecs
  7. =====================================================================
  8. .au G711u, G711a, PCM format, any samplerate/channels
  9. .wav G711u, G711a, PCM, GSM 6.10 (MS), IMA ADPCM formats, any samplerate/channels
  10. .wav49 just alias of .wav, can content any of wav codecs
  11. .gsm raw GSM 6.10
  12. .sln raw PCM 16bit-signed 8kHz
  13. .raw alias of .sln
  14. .alaw raw G711a 8kHz mono
  15. .al alias of .alaw
  16. .ulaw raw G711u 8kHz mono
  17. .ul alias of .ulaw
  18. .mu alias of .ulaw
  19. .pcm alias of .ulaw
  20. .la raw G711a 8kHz mono in inverted bit order
  21. .lu raw G711u 8kHz mono in inverted bit order
  22. =====================================================================
  23. Flash interface:
  24. You can select one of two interfaces:
  25. 1: (minimal) Just one button.
  26. To select it, pass gui=mini in agruments, or nothing
  27. shape of circle = buffering, click to stop
  28. shape of square = playing, click to pause playback
  29. shape of triangle = stopped, click to play last file
  30. shape of two bars = paused. click to continue play
  31. 2: (wide) Control button as above plus position bar for scrolling
  32. To select it, pass gui=full in arguments
  33. short ticks are 10 second, long ticks are minutes.
  34. pass arguments: h=height of player, w=width of player.
  35. field of control button are square of h*h, rest space used for
  36. position bar.
  37. 3: (none) no interface at all. transparent dot displayed.
  38. To select it, pass gui=none in arguments
  39. Flash Interface customize:
  40. Pass parameters to specify colors:
  41. bg_color: (default 0x303030) Color of background
  42. ready_color: (default 0xA0A0A0) Color of loaded bar
  43. cursor_color: (default 0x7FA03F) Color of cursor mark
  44. button_color: (default 0x808080) Color of play/pause button
  45. minor_tick_color: (default 0x006600) Color of minor tick score
  46. major_tick_color: (default 0x000066) Color of major tick score
  47. JS interface:
  48. doPlay([filename][, buffer]) or play([filename][, buffer])
  49. start playback of given filename. if filename not given -- play last
  50. buffer argument says minimum buffer length needed to start playback
  51. doStop() or stop()
  52. stop playback of current file
  53. doPause() or pause()
  54. pauses playback of current file
  55. doResume() or resume()
  56. resume playback of current file after pause. will throw error if not started
  57. doSeek(pos) or seek()
  58. seeks playback to position (in seconds)
  59. setVolume(value) or volume(value)
  60. set playback volume to specifed value. 1.0 by default
  61. initial value get from flash parameter "value"
  62. getVolume() or volume()
  63. get playback volume
  64. setPan(value) or pan(value)
  65. set playback pan (-1.0 is 100% left, 0.0 is center(default), 1.0 is 100% right)
  66. initial value get from flash parameter "pan"
  67. getPan(value) or pan()
  68. get playback pan
  69. attachHandler(Event, Handler[, User]) -> handlerId
  70. when Event occurs, Handler will be called, with optionally User info as first argument
  71. detachHandler(Event, Handler[, User])
  72. detach all Event handlers, identified by Event/Handler/User triplet
  73. removeHandler(HandlerId)
  74. detach event handler, identified by handlerId, returent by previous call to attachHandler
  75. JS callbacks:
  76. onWavPlayerReady(id)
  77. fired when wavPlayer ready to be controlled
  78. JS events:
  79. !!! WARNING !!!
  80. Do not do any time-consuming operations in callbacks --
  81. It can cause hangs from browser to whole system.
  82. To change any DOM elements / innerHTML / ask user --
  83. fire function in separate thread with setTimeout()
  84. !!! ACHTUNG !!!
  85. *(eventName[, User][, Arguments])
  86. fired on any events. first argument then eventName, next is user-supplied argument, rest is event arguments
  87. PLAYER_BUFFERING([position])
  88. fired when player starts buffering of sound.
  89. optionally, passed current file position (if known)
  90. PLAYER_LOAD(soundAvailable, soundTotal)
  91. fired when player loads sound stream.
  92. soundAvailable = sound length in seconds available to play right now
  93. soundTotal = total sound length in file, if known
  94. PLAYER_PLAYING([position])
  95. fired when player starts playing sound
  96. start of playback position passed, if position known
  97. PLAYER_STOPPED([position])
  98. fired when player stops playing sound
  99. stopped position passed, if known
  100. PLAYER_PAUSED([position])
  101. fired when player paused playing sound
  102. current pause position passed, if known
  103. progress(bytesLoaded, bytesTotal)
  104. fired when player loaded next chunk from file.
  105. See usage example in debug.html and index.html