summaryrefslogtreecommitdiff
path: root/modules/minimp3/doc_classes/AudioStreamMP3.xml
diff options
context:
space:
mode:
authorJiri Suchan <yed@vanyli.net>2023-01-30 22:21:36 +0800
committerJiri Suchan <yed@vanyli.net>2023-01-30 22:43:08 +0800
commit4a4adec33db7a928418ade06cd54823fd541b786 (patch)
tree3220681daa6fbfc191894727b3d84baf3b898740 /modules/minimp3/doc_classes/AudioStreamMP3.xml
parent312011fadec12c98eb14791bb0b19c63463d98ae (diff)
docs: replace File with FileAccess
Diffstat (limited to 'modules/minimp3/doc_classes/AudioStreamMP3.xml')
-rw-r--r--modules/minimp3/doc_classes/AudioStreamMP3.xml8
1 files changed, 2 insertions, 6 deletions
diff --git a/modules/minimp3/doc_classes/AudioStreamMP3.xml b/modules/minimp3/doc_classes/AudioStreamMP3.xml
index 8f03681c06..a88ff23b6b 100644
--- a/modules/minimp3/doc_classes/AudioStreamMP3.xml
+++ b/modules/minimp3/doc_classes/AudioStreamMP3.xml
@@ -21,21 +21,17 @@
[codeblocks]
[gdscript]
func load_mp3(path):
- var file = File.new()
- file.open(path, File.READ)
+ var file = FileAccess.open(path, FileAccess.READ)
var sound = AudioStreamMP3.new()
sound.data = file.get_buffer(file.get_length())
- file.close()
return sound
[/gdscript]
[csharp]
public AudioStreamMP3 LoadMP3(string path)
{
- var file = new File();
- file.Open(path, File.READ);
+ using var file = FileAccess.Open(path, FileAccess.ModeFlags.Read);
var sound = new AudioStreamMP3();
sound.Data = file.GetBuffer(file.GetLength());
- file.Close();
return sound;
}
[/csharp]