0.2.0-dev Download ZIP
63 lines ·3.3 KB Raw
| 1 | <?xml version="1.0" encoding="UTF-8" ?> |
| 2 | <class name="AudioStreamPlaybackPolyphonic" inherits="AudioStreamPlayback" api_type="core" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd"> |
| 3 | <brief_description> |
| 4 | Playback instance for [AudioStreamPolyphonic]. |
| 5 | </brief_description> |
| 6 | <description> |
| 7 | Playback instance for [AudioStreamPolyphonic]. After setting the [code]stream[/code] property of [AudioStreamPlayer], [AudioStreamPlayer2D], or [AudioStreamPlayer3D], the playback instance can be obtained by calling [method AudioStreamPlayer.get_stream_playback], [method AudioStreamPlayer2D.get_stream_playback] or [method AudioStreamPlayer3D.get_stream_playback] methods. |
| 8 | </description> |
| 9 | <tutorials> |
| 10 | </tutorials> |
| 11 | <methods> |
| 12 | <method name="is_stream_playing" qualifiers="const"> |
| 13 | <return type="bool" /> |
| 14 | <param index="0" name="stream" type="int" /> |
| 15 | <description> |
| 16 | Returns [code]true[/code] if the stream associated with the given integer ID is still playing. Check [method play_stream] for information on when this ID becomes invalid. |
| 17 | </description> |
| 18 | </method> |
| 19 | <method name="play_stream"> |
| 20 | <return type="int" /> |
| 21 | <param index="0" name="stream" type="AudioStream" /> |
| 22 | <param index="1" name="from_offset" type="float" default="0" /> |
| 23 | <param index="2" name="volume_db" type="float" default="0" /> |
| 24 | <param index="3" name="pitch_scale" type="float" default="1.0" /> |
| 25 | <param index="4" name="playback_type" type="int" enum="AudioServer.PlaybackType" default="0" /> |
| 26 | <param index="5" name="bus" type="StringName" default="&"Master"" /> |
| 27 | <description> |
| 28 | Play an [AudioStream] at a given offset, volume, pitch scale, playback type, and bus. Playback starts immediately. |
| 29 | The return value is a unique integer ID that is associated to this playback stream and which can be used to control it. |
| 30 | This ID becomes invalid when the stream ends (if it does not loop), when the [AudioStreamPlaybackPolyphonic] is stopped, or when [method stop_stream] is called. |
| 31 | This function returns [constant INVALID_ID] if the amount of streams currently playing equals [member AudioStreamPolyphonic.polyphony]. If you need a higher amount of maximum polyphony, raise this value. |
| 32 | </description> |
| 33 | </method> |
| 34 | <method name="set_stream_pitch_scale"> |
| 35 | <return type="void" /> |
| 36 | <param index="0" name="stream" type="int" /> |
| 37 | <param index="1" name="pitch_scale" type="float" /> |
| 38 | <description> |
| 39 | Change the stream pitch scale. The [param stream] argument is an integer ID returned by [method play_stream]. |
| 40 | </description> |
| 41 | </method> |
| 42 | <method name="set_stream_volume"> |
| 43 | <return type="void" /> |
| 44 | <param index="0" name="stream" type="int" /> |
| 45 | <param index="1" name="volume_db" type="float" /> |
| 46 | <description> |
| 47 | Change the stream volume (in db). The [param stream] argument is an integer ID returned by [method play_stream]. |
| 48 | </description> |
| 49 | </method> |
| 50 | <method name="stop_stream"> |
| 51 | <return type="void" /> |
| 52 | <param index="0" name="stream" type="int" /> |
| 53 | <description> |
| 54 | Stop a stream. The [param stream] argument is an integer ID returned by [method play_stream], which becomes invalid after calling this function. |
| 55 | </description> |
| 56 | </method> |
| 57 | </methods> |
| 58 | <constants> |
| 59 | <constant name="INVALID_ID" value="-1"> |
| 60 | Returned by [method play_stream] in case it could not allocate a stream for playback. |
| 61 | </constant> |
| 62 | </constants> |
| 63 | </class> |