class_sampleplayer.rst 41 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479
  1. .. Generated automatically by doc/tools/makerst.py in Godot's source tree.
  2. .. DO NOT EDIT THIS FILE, but the doc/base/classes.xml source instead.
  3. .. _class_SamplePlayer:
  4. SamplePlayer
  5. ============
  6. **Inherits:** :ref:`Node<class_node>` **<** :ref:`Object<class_object>`
  7. **Category:** Core
  8. Brief Description
  9. -----------------
  10. Sample Player node.
  11. Member Functions
  12. ----------------
  13. +--------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  14. | :ref:`float<class_float>` | :ref:`get_chorus<class_SamplePlayer_get_chorus>` **(** :ref:`int<class_int>` voice **)** const |
  15. +--------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  16. | :ref:`float<class_float>` | :ref:`get_default_chorus<class_SamplePlayer_get_default_chorus>` **(** **)** const |
  17. +--------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  18. | :ref:`float<class_float>` | :ref:`get_default_filter_cutoff<class_SamplePlayer_get_default_filter_cutoff>` **(** **)** const |
  19. +--------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  20. | :ref:`float<class_float>` | :ref:`get_default_filter_gain<class_SamplePlayer_get_default_filter_gain>` **(** **)** const |
  21. +--------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  22. | :ref:`float<class_float>` | :ref:`get_default_filter_resonance<class_SamplePlayer_get_default_filter_resonance>` **(** **)** const |
  23. +--------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  24. | :ref:`int<class_int>` | :ref:`get_default_filter_type<class_SamplePlayer_get_default_filter_type>` **(** **)** const |
  25. +--------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  26. | :ref:`float<class_float>` | :ref:`get_default_pan<class_SamplePlayer_get_default_pan>` **(** **)** const |
  27. +--------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  28. | :ref:`float<class_float>` | :ref:`get_default_pan_depth<class_SamplePlayer_get_default_pan_depth>` **(** **)** const |
  29. +--------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  30. | :ref:`float<class_float>` | :ref:`get_default_pan_height<class_SamplePlayer_get_default_pan_height>` **(** **)** const |
  31. +--------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  32. | :ref:`float<class_float>` | :ref:`get_default_pitch_scale<class_SamplePlayer_get_default_pitch_scale>` **(** **)** const |
  33. +--------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  34. | :ref:`float<class_float>` | :ref:`get_default_reverb<class_SamplePlayer_get_default_reverb>` **(** **)** const |
  35. +--------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  36. | :ref:`int<class_int>` | :ref:`get_default_reverb_room<class_SamplePlayer_get_default_reverb_room>` **(** **)** const |
  37. +--------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  38. | :ref:`float<class_float>` | :ref:`get_default_volume<class_SamplePlayer_get_default_volume>` **(** **)** const |
  39. +--------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  40. | :ref:`float<class_float>` | :ref:`get_default_volume_db<class_SamplePlayer_get_default_volume_db>` **(** **)** const |
  41. +--------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  42. | :ref:`float<class_float>` | :ref:`get_filter_cutoff<class_SamplePlayer_get_filter_cutoff>` **(** :ref:`int<class_int>` voice **)** const |
  43. +--------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  44. | :ref:`float<class_float>` | :ref:`get_filter_gain<class_SamplePlayer_get_filter_gain>` **(** :ref:`int<class_int>` voice **)** const |
  45. +--------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  46. | :ref:`float<class_float>` | :ref:`get_filter_resonance<class_SamplePlayer_get_filter_resonance>` **(** :ref:`int<class_int>` voice **)** const |
  47. +--------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  48. | :ref:`int<class_int>` | :ref:`get_filter_type<class_SamplePlayer_get_filter_type>` **(** :ref:`int<class_int>` voice **)** const |
  49. +--------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  50. | :ref:`int<class_int>` | :ref:`get_mix_rate<class_SamplePlayer_get_mix_rate>` **(** :ref:`int<class_int>` voice **)** const |
  51. +--------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  52. | :ref:`float<class_float>` | :ref:`get_pan<class_SamplePlayer_get_pan>` **(** :ref:`int<class_int>` voice **)** const |
  53. +--------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  54. | :ref:`float<class_float>` | :ref:`get_pan_depth<class_SamplePlayer_get_pan_depth>` **(** :ref:`int<class_int>` voice **)** const |
  55. +--------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  56. | :ref:`float<class_float>` | :ref:`get_pan_height<class_SamplePlayer_get_pan_height>` **(** :ref:`int<class_int>` voice **)** const |
  57. +--------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  58. | :ref:`float<class_float>` | :ref:`get_pitch_scale<class_SamplePlayer_get_pitch_scale>` **(** :ref:`int<class_int>` voice **)** const |
  59. +--------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  60. | :ref:`int<class_int>` | :ref:`get_polyphony<class_SamplePlayer_get_polyphony>` **(** **)** const |
  61. +--------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  62. | :ref:`float<class_float>` | :ref:`get_reverb<class_SamplePlayer_get_reverb>` **(** :ref:`int<class_int>` voice **)** const |
  63. +--------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  64. | :ref:`int<class_int>` | :ref:`get_reverb_room<class_SamplePlayer_get_reverb_room>` **(** :ref:`int<class_int>` voice **)** const |
  65. +--------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  66. | :ref:`SampleLibrary<class_samplelibrary>` | :ref:`get_sample_library<class_SamplePlayer_get_sample_library>` **(** **)** const |
  67. +--------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  68. | :ref:`float<class_float>` | :ref:`get_volume<class_SamplePlayer_get_volume>` **(** :ref:`int<class_int>` voice **)** const |
  69. +--------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  70. | :ref:`float<class_float>` | :ref:`get_volume_db<class_SamplePlayer_get_volume_db>` **(** :ref:`int<class_int>` voice **)** const |
  71. +--------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  72. | :ref:`bool<class_bool>` | :ref:`is_active<class_SamplePlayer_is_active>` **(** **)** const |
  73. +--------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  74. | :ref:`bool<class_bool>` | :ref:`is_voice_active<class_SamplePlayer_is_voice_active>` **(** :ref:`int<class_int>` voice **)** const |
  75. +--------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  76. | :ref:`int<class_int>` | :ref:`play<class_SamplePlayer_play>` **(** :ref:`String<class_string>` name, :ref:`bool<class_bool>` unique=false **)** |
  77. +--------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  78. | void | :ref:`set_chorus<class_SamplePlayer_set_chorus>` **(** :ref:`int<class_int>` voice, :ref:`float<class_float>` send **)** |
  79. +--------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  80. | void | :ref:`set_default_chorus<class_SamplePlayer_set_default_chorus>` **(** :ref:`float<class_float>` send **)** |
  81. +--------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  82. | void | :ref:`set_default_filter<class_SamplePlayer_set_default_filter>` **(** :ref:`int<class_int>` type, :ref:`float<class_float>` cutoff_hz, :ref:`float<class_float>` resonance, :ref:`float<class_float>` gain=0 **)** |
  83. +--------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  84. | void | :ref:`set_default_pan<class_SamplePlayer_set_default_pan>` **(** :ref:`float<class_float>` pan, :ref:`float<class_float>` depth=0, :ref:`float<class_float>` height=0 **)** |
  85. +--------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  86. | void | :ref:`set_default_pitch_scale<class_SamplePlayer_set_default_pitch_scale>` **(** :ref:`float<class_float>` ratio **)** |
  87. +--------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  88. | void | :ref:`set_default_reverb<class_SamplePlayer_set_default_reverb>` **(** :ref:`int<class_int>` room_type, :ref:`float<class_float>` send **)** |
  89. +--------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  90. | void | :ref:`set_default_volume<class_SamplePlayer_set_default_volume>` **(** :ref:`float<class_float>` volume **)** |
  91. +--------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  92. | void | :ref:`set_default_volume_db<class_SamplePlayer_set_default_volume_db>` **(** :ref:`float<class_float>` db **)** |
  93. +--------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  94. | void | :ref:`set_filter<class_SamplePlayer_set_filter>` **(** :ref:`int<class_int>` voice, :ref:`int<class_int>` type, :ref:`float<class_float>` cutoff_hz, :ref:`float<class_float>` resonance, :ref:`float<class_float>` gain=0 **)** |
  95. +--------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  96. | void | :ref:`set_mix_rate<class_SamplePlayer_set_mix_rate>` **(** :ref:`int<class_int>` voice, :ref:`int<class_int>` hz **)** |
  97. +--------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  98. | void | :ref:`set_pan<class_SamplePlayer_set_pan>` **(** :ref:`int<class_int>` voice, :ref:`float<class_float>` pan, :ref:`float<class_float>` depth=0, :ref:`float<class_float>` height=0 **)** |
  99. +--------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  100. | void | :ref:`set_pitch_scale<class_SamplePlayer_set_pitch_scale>` **(** :ref:`int<class_int>` voice, :ref:`float<class_float>` ratio **)** |
  101. +--------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  102. | void | :ref:`set_polyphony<class_SamplePlayer_set_polyphony>` **(** :ref:`int<class_int>` max_voices **)** |
  103. +--------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  104. | void | :ref:`set_reverb<class_SamplePlayer_set_reverb>` **(** :ref:`int<class_int>` voice, :ref:`int<class_int>` room_type, :ref:`float<class_float>` send **)** |
  105. +--------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  106. | void | :ref:`set_sample_library<class_SamplePlayer_set_sample_library>` **(** :ref:`SampleLibrary<class_samplelibrary>` library **)** |
  107. +--------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  108. | void | :ref:`set_volume<class_SamplePlayer_set_volume>` **(** :ref:`int<class_int>` voice, :ref:`float<class_float>` volume **)** |
  109. +--------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  110. | void | :ref:`set_volume_db<class_SamplePlayer_set_volume_db>` **(** :ref:`int<class_int>` voice, :ref:`float<class_float>` db **)** |
  111. +--------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  112. | void | :ref:`stop<class_SamplePlayer_stop>` **(** :ref:`int<class_int>` voice **)** |
  113. +--------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  114. | void | :ref:`stop_all<class_SamplePlayer_stop_all>` **(** **)** |
  115. +--------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  116. Numeric Constants
  117. -----------------
  118. - **FILTER_NONE** = **0** --- Filter is disabled for voice.
  119. - **FILTER_LOWPASS** = **1** --- Low-pass filter is used for voice.
  120. - **FILTER_BANDPASS** = **2** --- Band-pass filter is used for voice.
  121. - **FILTER_HIPASS** = **3** --- High-pass filter is used for voice.
  122. - **FILTER_NOTCH** = **4** --- Notch (band reject) filter is used for voice.
  123. - **FILTER_PEAK** = **5** --- Peak (exclusive band) filter is used for voice.
  124. - **FILTER_BANDLIMIT** = **6** --- Band-limit filter is used for voice, in this case resonance is the high-pass cutoff. A band-limit filter has a different frequency response than a notch filter, but otherwise both are band-rejecting filters.
  125. - **FILTER_LOW_SHELF** = **7** --- Low-shelf filter is used for voice.
  126. - **FILTER_HIGH_SHELF** = **8** --- High-shelf filter is used for voice.
  127. - **REVERB_SMALL** = **0** --- Small reverberation room (house room).
  128. - **REVERB_MEDIUM** = **1** --- Medium reverberation room (street)
  129. - **REVERB_LARGE** = **2** --- Large reverberation room (theatre)
  130. - **REVERB_HALL** = **3** --- Huge reverberation room (cathedral, warehouse).
  131. - **INVALID_VOICE_ID** = **-1** --- Value returned if the voice ID is invalid.
  132. Description
  133. -----------
  134. SamplePlayer is a :ref:`Node<class_node>` meant for simple sample playback. A library of samples is loaded and played back "as is", without positioning or anything.
  135. Member Function Description
  136. ---------------------------
  137. .. _class_SamplePlayer_get_chorus:
  138. - :ref:`float<class_float>` **get_chorus** **(** :ref:`int<class_int>` voice **)** const
  139. Return the current chorus send level for a given voice.
  140. .. _class_SamplePlayer_get_default_chorus:
  141. - :ref:`float<class_float>` **get_default_chorus** **(** **)** const
  142. Return the default chorus send level of the player.
  143. .. _class_SamplePlayer_get_default_filter_cutoff:
  144. - :ref:`float<class_float>` **get_default_filter_cutoff** **(** **)** const
  145. Return the default filter cutoff frequency of the player.
  146. .. _class_SamplePlayer_get_default_filter_gain:
  147. - :ref:`float<class_float>` **get_default_filter_gain** **(** **)** const
  148. Return the default filter gain of the player.
  149. .. _class_SamplePlayer_get_default_filter_resonance:
  150. - :ref:`float<class_float>` **get_default_filter_resonance** **(** **)** const
  151. Return the default filter resonance of the player.
  152. .. _class_SamplePlayer_get_default_filter_type:
  153. - :ref:`int<class_int>` **get_default_filter_type** **(** **)** const
  154. Return the default filter type in use (see FILTER\_\* constants) for the player.
  155. .. _class_SamplePlayer_get_default_pan:
  156. - :ref:`float<class_float>` **get_default_pan** **(** **)** const
  157. Return the default panning of the player.
  158. .. _class_SamplePlayer_get_default_pan_depth:
  159. - :ref:`float<class_float>` **get_default_pan_depth** **(** **)** const
  160. Return the default pan depth of the player.
  161. .. _class_SamplePlayer_get_default_pan_height:
  162. - :ref:`float<class_float>` **get_default_pan_height** **(** **)** const
  163. Return the default pan height of the player.
  164. .. _class_SamplePlayer_get_default_pitch_scale:
  165. - :ref:`float<class_float>` **get_default_pitch_scale** **(** **)** const
  166. Return the default pitch scale of the player.
  167. .. _class_SamplePlayer_get_default_reverb:
  168. - :ref:`float<class_float>` **get_default_reverb** **(** **)** const
  169. Return the default reverberation send level of the player.
  170. .. _class_SamplePlayer_get_default_reverb_room:
  171. - :ref:`int<class_int>` **get_default_reverb_room** **(** **)** const
  172. Return the default reverberation room type of the player (see REVERB\_\* enum).
  173. .. _class_SamplePlayer_get_default_volume:
  174. - :ref:`float<class_float>` **get_default_volume** **(** **)** const
  175. Return the default volume (on a linear scale) of the player.
  176. .. _class_SamplePlayer_get_default_volume_db:
  177. - :ref:`float<class_float>` **get_default_volume_db** **(** **)** const
  178. Return the default volume (in dB) of the player.
  179. .. _class_SamplePlayer_get_filter_cutoff:
  180. - :ref:`float<class_float>` **get_filter_cutoff** **(** :ref:`int<class_int>` voice **)** const
  181. Return the current filter cutoff frequency for a given voice.
  182. .. _class_SamplePlayer_get_filter_gain:
  183. - :ref:`float<class_float>` **get_filter_gain** **(** :ref:`int<class_int>` voice **)** const
  184. Return the current filter gain for a given voice.
  185. .. _class_SamplePlayer_get_filter_resonance:
  186. - :ref:`float<class_float>` **get_filter_resonance** **(** :ref:`int<class_int>` voice **)** const
  187. Return the current filter resonance for a given voice.
  188. .. _class_SamplePlayer_get_filter_type:
  189. - :ref:`int<class_int>` **get_filter_type** **(** :ref:`int<class_int>` voice **)** const
  190. Return the current filter type in use (see FILTER\_\* constants) for a given voice.
  191. .. _class_SamplePlayer_get_mix_rate:
  192. - :ref:`int<class_int>` **get_mix_rate** **(** :ref:`int<class_int>` voice **)** const
  193. Return the current mix rate for a given voice.
  194. .. _class_SamplePlayer_get_pan:
  195. - :ref:`float<class_float>` **get_pan** **(** :ref:`int<class_int>` voice **)** const
  196. Return the current panning for a given voice.
  197. .. _class_SamplePlayer_get_pan_depth:
  198. - :ref:`float<class_float>` **get_pan_depth** **(** :ref:`int<class_int>` voice **)** const
  199. Return the current pan depth for a given voice.
  200. .. _class_SamplePlayer_get_pan_height:
  201. - :ref:`float<class_float>` **get_pan_height** **(** :ref:`int<class_int>` voice **)** const
  202. Return the current pan height for a given voice.
  203. .. _class_SamplePlayer_get_pitch_scale:
  204. - :ref:`float<class_float>` **get_pitch_scale** **(** :ref:`int<class_int>` voice **)** const
  205. Return the current pitch scale for a given voice.
  206. .. _class_SamplePlayer_get_polyphony:
  207. - :ref:`int<class_int>` **get_polyphony** **(** **)** const
  208. Return the polyphony of the player.
  209. .. _class_SamplePlayer_get_reverb:
  210. - :ref:`float<class_float>` **get_reverb** **(** :ref:`int<class_int>` voice **)** const
  211. Return the current reverberation send level for a given voice.
  212. .. _class_SamplePlayer_get_reverb_room:
  213. - :ref:`int<class_int>` **get_reverb_room** **(** :ref:`int<class_int>` voice **)** const
  214. Return the current reverberation room type for a given voice (see REVERB\_\* enum).
  215. .. _class_SamplePlayer_get_sample_library:
  216. - :ref:`SampleLibrary<class_samplelibrary>` **get_sample_library** **(** **)** const
  217. Return the sample library used by the player.
  218. .. _class_SamplePlayer_get_volume:
  219. - :ref:`float<class_float>` **get_volume** **(** :ref:`int<class_int>` voice **)** const
  220. Return the current volume (on a linear scale) for a given voice.
  221. .. _class_SamplePlayer_get_volume_db:
  222. - :ref:`float<class_float>` **get_volume_db** **(** :ref:`int<class_int>` voice **)** const
  223. Return the current volume (in dB) for a given voice.
  224. .. _class_SamplePlayer_is_active:
  225. - :ref:`bool<class_bool>` **is_active** **(** **)** const
  226. Return whether the player is currently active.
  227. .. _class_SamplePlayer_is_voice_active:
  228. - :ref:`bool<class_bool>` **is_voice_active** **(** :ref:`int<class_int>` voice **)** const
  229. Return whether the given voice is currently active.
  230. .. _class_SamplePlayer_play:
  231. - :ref:`int<class_int>` **play** **(** :ref:`String<class_string>` name, :ref:`bool<class_bool>` unique=false **)**
  232. Play a sample referenced by its name.
  233. Optionally, the playback can be made "unique" to force stopping all other samples currently played. The voices allocated for playback will then be returned.
  234. .. _class_SamplePlayer_set_chorus:
  235. - void **set_chorus** **(** :ref:`int<class_int>` voice, :ref:`float<class_float>` send **)**
  236. Set the chorus send level of a voice (from 0 to 1.0). For setting chorus parameters, see :ref:`AudioServer<class_audioserver>`.
  237. .. _class_SamplePlayer_set_default_chorus:
  238. - void **set_default_chorus** **(** :ref:`float<class_float>` send **)**
  239. Set the default chorus send level of the player (from 0 to 1.0). For setting chorus parameters, see :ref:`AudioServer<class_audioserver>`.
  240. .. _class_SamplePlayer_set_default_filter:
  241. - void **set_default_filter** **(** :ref:`int<class_int>` type, :ref:`float<class_float>` cutoff_hz, :ref:`float<class_float>` resonance, :ref:`float<class_float>` gain=0 **)**
  242. Set the default filter for the player, using the given type (see FILTER\_\* constants), cutoff frequency (from 20 to 16,384 Hz) and resonance (from 0 to 4.0).
  243. Optionally, a gain can also be given (from 0 to 2.0).
  244. .. _class_SamplePlayer_set_default_pan:
  245. - void **set_default_pan** **(** :ref:`float<class_float>` pan, :ref:`float<class_float>` depth=0, :ref:`float<class_float>` height=0 **)**
  246. Set the default panning of the player. Panning goes from -1.0 (left) to +1.0 (right).
  247. Optionally, for hardware than support 3D sound, one can also set depth and height (also in range -1.0 to +1.0).
  248. .. _class_SamplePlayer_set_default_pitch_scale:
  249. - void **set_default_pitch_scale** **(** :ref:`float<class_float>` ratio **)**
  250. Set the default pitch scale of the player. A ratio of 1.0 is the normal scale.
  251. .. _class_SamplePlayer_set_default_reverb:
  252. - void **set_default_reverb** **(** :ref:`int<class_int>` room_type, :ref:`float<class_float>` send **)**
  253. Set the default reverberation type (see REVERB\_\* constants) and send level (from 0 to 1.0) of the player.
  254. .. _class_SamplePlayer_set_default_volume:
  255. - void **set_default_volume** **(** :ref:`float<class_float>` volume **)**
  256. Set the default volume of the player using a linear scale.
  257. The "volume" argument should be a positive factor ranging from 0.0 (mute) up to 16.0 (i.e. 24 dB).
  258. A factor of 1.0 means that the voice will be played at normal system volume. Factors above 1.0 might be limited by the platform's audio output.
  259. .. _class_SamplePlayer_set_default_volume_db:
  260. - void **set_default_volume_db** **(** :ref:`float<class_float>` db **)**
  261. Set the default volume of the player in dB.
  262. The "dB" argument can range from -80 to 24 dB, 0 dB being the maximum volume. Every 6 dB (resp. -6 dB), the volume is increased (resp. reduced) by half.
  263. .. _class_SamplePlayer_set_filter:
  264. - void **set_filter** **(** :ref:`int<class_int>` voice, :ref:`int<class_int>` type, :ref:`float<class_float>` cutoff_hz, :ref:`float<class_float>` resonance, :ref:`float<class_float>` gain=0 **)**
  265. Set the filter for a given voice, using the given type (see FILTER\_\* constants), cutoff frequency (from 20 to 16,384 Hz) and resonance (from 0 to 4.0).
  266. Optionally, a gain can also be given (from 0 to 2.0).
  267. .. _class_SamplePlayer_set_mix_rate:
  268. - void **set_mix_rate** **(** :ref:`int<class_int>` voice, :ref:`int<class_int>` hz **)**
  269. Set the mix rate (in Hz) of a given voice.
  270. .. _class_SamplePlayer_set_pan:
  271. - void **set_pan** **(** :ref:`int<class_int>` voice, :ref:`float<class_float>` pan, :ref:`float<class_float>` depth=0, :ref:`float<class_float>` height=0 **)**
  272. Set the panning of a voice. Panning goes from -1.0 (left) to +1.0 (right).
  273. Optionally, for hardware than support 3D sound, one can also set depth and height (also in range -1.0 to +1.0).
  274. .. _class_SamplePlayer_set_pitch_scale:
  275. - void **set_pitch_scale** **(** :ref:`int<class_int>` voice, :ref:`float<class_float>` ratio **)**
  276. Set the pitch scale of a given voice. A ratio of 1.0 is the normal scale.
  277. .. _class_SamplePlayer_set_polyphony:
  278. - void **set_polyphony** **(** :ref:`int<class_int>` max_voices **)**
  279. Set the polyphony of the player (maximum amount of simultaneous voices).
  280. .. _class_SamplePlayer_set_reverb:
  281. - void **set_reverb** **(** :ref:`int<class_int>` voice, :ref:`int<class_int>` room_type, :ref:`float<class_float>` send **)**
  282. Set the reverberation type (see REVERB\_\* constants) and send level (from 0 to 1.0) of a voice.
  283. .. _class_SamplePlayer_set_sample_library:
  284. - void **set_sample_library** **(** :ref:`SampleLibrary<class_samplelibrary>` library **)**
  285. Set the sample library for the player.
  286. .. _class_SamplePlayer_set_volume:
  287. - void **set_volume** **(** :ref:`int<class_int>` voice, :ref:`float<class_float>` volume **)**
  288. Set the volume of a given voice using a linear scale.
  289. The "volume" argument should be a positive factor ranging from 0.0 (mute) up to 16.0 (i.e. 24 dB).
  290. A factor of 1.0 means that the voice will be played at normal system volume. Factors above 1.0 might be limited by the platform's audio output.
  291. .. _class_SamplePlayer_set_volume_db:
  292. - void **set_volume_db** **(** :ref:`int<class_int>` voice, :ref:`float<class_float>` db **)**
  293. Set the volume of a given voice in dB.
  294. The "dB" argument can range from -80 to 24 dB, 0 dB being the maximum volume. Every 6 dB (resp. -6 dB), the volume is increased (resp. reduced) by half.
  295. .. _class_SamplePlayer_stop:
  296. - void **stop** **(** :ref:`int<class_int>` voice **)**
  297. Stop a given voice.
  298. .. _class_SamplePlayer_stop_all:
  299. - void **stop_all** **(** **)**
  300. Stop all playing voices.