Fix AudioStreamPlayer2D and 3D's playing not updating right away
This commit is contained in:
@ -29,7 +29,7 @@
|
|||||||
<return type="void" />
|
<return type="void" />
|
||||||
<param index="0" name="from_position" type="float" default="0.0" />
|
<param index="0" name="from_position" type="float" default="0.0" />
|
||||||
<description>
|
<description>
|
||||||
Plays the audio from the given position [param from_position], in seconds.
|
Queues the audio to play on the next physics frame, from the given position [param from_position], in seconds.
|
||||||
</description>
|
</description>
|
||||||
</method>
|
</method>
|
||||||
<method name="seek">
|
<method name="seek">
|
||||||
@ -73,7 +73,7 @@
|
|||||||
The pitch and the tempo of the audio, as a multiplier of the audio sample's sample rate.
|
The pitch and the tempo of the audio, as a multiplier of the audio sample's sample rate.
|
||||||
</member>
|
</member>
|
||||||
<member name="playing" type="bool" setter="_set_playing" getter="is_playing" default="false">
|
<member name="playing" type="bool" setter="_set_playing" getter="is_playing" default="false">
|
||||||
If [code]true[/code], audio is playing.
|
If [code]true[/code], audio is playing or is queued to be played (see [method play]).
|
||||||
</member>
|
</member>
|
||||||
<member name="stream" type="AudioStream" setter="set_stream" getter="get_stream">
|
<member name="stream" type="AudioStream" setter="set_stream" getter="get_stream">
|
||||||
The [AudioStream] object to be played.
|
The [AudioStream] object to be played.
|
||||||
|
|||||||
@ -29,7 +29,7 @@
|
|||||||
<return type="void" />
|
<return type="void" />
|
||||||
<param index="0" name="from_position" type="float" default="0.0" />
|
<param index="0" name="from_position" type="float" default="0.0" />
|
||||||
<description>
|
<description>
|
||||||
Plays the audio from the given position [param from_position], in seconds.
|
Queues the audio to play on the next physics frame, from the given position [param from_position], in seconds.
|
||||||
</description>
|
</description>
|
||||||
</method>
|
</method>
|
||||||
<method name="seek">
|
<method name="seek">
|
||||||
@ -94,7 +94,7 @@
|
|||||||
The pitch and the tempo of the audio, as a multiplier of the audio sample's sample rate.
|
The pitch and the tempo of the audio, as a multiplier of the audio sample's sample rate.
|
||||||
</member>
|
</member>
|
||||||
<member name="playing" type="bool" setter="_set_playing" getter="is_playing" default="false">
|
<member name="playing" type="bool" setter="_set_playing" getter="is_playing" default="false">
|
||||||
If [code]true[/code], audio is playing.
|
If [code]true[/code], audio is playing or is queued to be played (see [method play]).
|
||||||
</member>
|
</member>
|
||||||
<member name="stream" type="AudioStream" setter="set_stream" getter="get_stream">
|
<member name="stream" type="AudioStream" setter="set_stream" getter="get_stream">
|
||||||
The [AudioStream] resource to be played.
|
The [AudioStream] resource to be played.
|
||||||
|
|||||||
@ -284,6 +284,9 @@ bool AudioStreamPlayer2D::is_playing() const {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (setplay.get() >= 0) {
|
||||||
|
return true; // play() has been called this frame, but no playback exists just yet.
|
||||||
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -606,6 +606,9 @@ bool AudioStreamPlayer3D::is_playing() const {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (setplay.get() >= 0) {
|
||||||
|
return true; // play() has been called this frame, but no playback exists just yet.
|
||||||
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user