Skip to content

Commit e5be5ea

Browse files
fix warnings
1 parent fcb37ed commit e5be5ea

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

audio/mic_input/MicRecord.gd

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -56,10 +56,10 @@ func _process(delta : float) -> void:
5656
if $MicToGenerator.button_pressed:
5757
$AudioGenerator.get_stream_playback().push_buffer(audio_samples)
5858
if generator_freq != 0.0:
59-
var gplayback = $AudioGenerator.get_stream_playback()
60-
var gdt = 1.0/$AudioGenerator.stream.mix_rate
59+
var gplayback : AudioStreamGeneratorPlayback = $AudioGenerator.get_stream_playback()
60+
var gdt : float = 1.0/$AudioGenerator.stream.mix_rate
6161
for i in range(gplayback.get_frames_available()):
62-
var a = 0.5*sin(generator_timestamp*generator_freq*TAU)
62+
var a : float = 0.5*sin(generator_timestamp*generator_freq*TAU)
6363
gplayback.push_frame(Vector2(a, a))
6464
generator_timestamp += gdt
6565

@@ -87,8 +87,8 @@ func _on_record_button_toggled(toggled_on : bool) -> void:
8787
recording_data.encode_u16(20, 1)
8888
recording_data.encode_u16(22, 2)
8989
recording_data.encode_u32(24, input_mix_rate)
90-
recording_data.encode_u32(28, input_mix_rate*16*2/8)
91-
recording_data.encode_u16(32, 16*2/8)
90+
recording_data.encode_u32(28, input_mix_rate*4) # *16*2/8
91+
recording_data.encode_u16(32, 4) # 16*2/8
9292
recording_data.encode_u16(34, 16)
9393
recording_data.encode_u32(36, 0x61746164) # 'data'
9494
recording_data.encode_u32(40, data_size)

0 commit comments

Comments
 (0)