We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 96d85a7 + 5a2ecb3 commit d5f6370Copy full SHA for d5f6370
1 file changed
GDScriptAudioImport.gd
@@ -64,8 +64,12 @@ func loadfile(filepath):
64
#parrrrseeeeee!!! :D
65
66
var bits_per_sample = 0
67
-
68
- for i in range(0, 100):
+ var i = 0
+ while true:
69
+ if i >= len(bytes) - 4: # Failsafe, if there is no data bytes
70
+ print("Data byte not found")
71
+ break
72
+
73
var those4bytes = str(char(bytes[i])+char(bytes[i+1])+char(bytes[i+2])+char(bytes[i+3]))
74
75
if those4bytes == "RIFF":
@@ -136,6 +140,10 @@ func loadfile(filepath):
136
140
newstream.data = convert_to_16bit(data, bits_per_sample)
137
141
else:
138
142
newstream.data = data
143
144
+ break # the data will be at the end, end searching here
145
146
+ i += 1
139
147
# end of parsing
148
#---------------------------
149
0 commit comments