@@ -56,10 +56,10 @@ func _process(delta : float) -> void:
56
56
if $ MicToGenerator .button_pressed :
57
57
$ AudioGenerator .get_stream_playback ().push_buffer (audio_samples )
58
58
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
61
61
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 )
63
63
gplayback .push_frame (Vector2 (a , a ))
64
64
generator_timestamp += gdt
65
65
@@ -87,8 +87,8 @@ func _on_record_button_toggled(toggled_on : bool) -> void:
87
87
recording_data .encode_u16 (20 , 1 )
88
88
recording_data .encode_u16 (22 , 2 )
89
89
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
92
92
recording_data .encode_u16 (34 , 16 )
93
93
recording_data .encode_u32 (36 , 0x61746164 ) # 'data'
94
94
recording_data .encode_u32 (40 , data_size )
0 commit comments