MicRecord.tscn 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166
  1. [gd_scene load_steps=4 format=3 uid="uid://dvjlkpjvjxn0h"]
  2. [ext_resource type="Script" path="res://MicRecord.gd" id="1"]
  3. [ext_resource type="AudioStream" uid="uid://c2re52petqrvx" path="res://Intro.ogg" id="2"]
  4. [sub_resource type="AudioStreamMicrophone" id="1"]
  5. [node name="MicRecord" type="Control"]
  6. layout_mode = 3
  7. anchors_preset = 8
  8. anchor_left = 0.5
  9. anchor_top = 0.5
  10. anchor_right = 0.5
  11. anchor_bottom = 0.5
  12. offset_left = -278.0
  13. offset_top = -224.0
  14. offset_right = 296.0
  15. offset_bottom = 226.0
  16. script = ExtResource("1")
  17. [node name="AudioStreamRecord" type="AudioStreamPlayer" parent="."]
  18. stream = SubResource("1")
  19. autoplay = true
  20. bus = &"Record"
  21. [node name="AudioStreamPlayer" type="AudioStreamPlayer" parent="."]
  22. autoplay = true
  23. [node name="AudioStreamPlayer2" type="AudioStreamPlayer" parent="."]
  24. stream = ExtResource("2")
  25. volume_db = -6.0
  26. [node name="Status" type="Label" parent="."]
  27. layout_mode = 1
  28. anchors_preset = 10
  29. anchor_right = 1.0
  30. offset_bottom = 26.0
  31. text = "Status: "
  32. horizontal_alignment = 1
  33. [node name="RecordButton" type="Button" parent="."]
  34. layout_mode = 0
  35. offset_left = 29.0
  36. offset_top = 77.0
  37. offset_right = 159.0
  38. offset_bottom = 117.0
  39. text = "Record"
  40. [node name="PlayButton" type="Button" parent="."]
  41. layout_mode = 0
  42. offset_left = 209.0
  43. offset_top = 77.0
  44. offset_right = 339.0
  45. offset_bottom = 117.0
  46. disabled = true
  47. text = "Play"
  48. [node name="PlayMusic" type="Button" parent="."]
  49. layout_mode = 0
  50. offset_left = 30.0
  51. offset_top = 395.0
  52. offset_right = 160.0
  53. offset_bottom = 435.0
  54. text = "Play Music"
  55. [node name="FormatLabel" type="Label" parent="."]
  56. layout_mode = 0
  57. offset_left = 33.0
  58. offset_top = 153.0
  59. offset_right = 102.0
  60. offset_bottom = 179.0
  61. text = "Format:"
  62. [node name="FormatOptionButton" type="OptionButton" parent="."]
  63. layout_mode = 0
  64. offset_left = 131.0
  65. offset_top = 150.0
  66. offset_right = 315.0
  67. offset_bottom = 181.0
  68. item_count = 3
  69. selected = 1
  70. popup/item_0/text = "8-bit Uncompressed"
  71. popup/item_0/id = 0
  72. popup/item_1/text = "16-bit Uncompressed"
  73. popup/item_1/id = 1
  74. popup/item_2/text = "IMA ADPCM Compression"
  75. popup/item_2/id = 2
  76. [node name="MixRateLabel" type="Label" parent="."]
  77. layout_mode = 0
  78. offset_left = 33.0
  79. offset_top = 192.0
  80. offset_right = 102.0
  81. offset_bottom = 218.0
  82. text = "Mix rate:"
  83. [node name="MixRateOptionButton" type="OptionButton" parent="."]
  84. layout_mode = 0
  85. offset_left = 131.0
  86. offset_top = 189.0
  87. offset_right = 220.0
  88. offset_bottom = 220.0
  89. item_count = 6
  90. selected = 4
  91. popup/item_0/text = "11025 Hz"
  92. popup/item_0/id = 0
  93. popup/item_1/text = "16000 Hz"
  94. popup/item_1/id = 1
  95. popup/item_2/text = "22050 Hz"
  96. popup/item_2/id = 2
  97. popup/item_3/text = "32000 Hz"
  98. popup/item_3/id = 3
  99. popup/item_4/text = "44100 Hz"
  100. popup/item_4/id = 4
  101. popup/item_5/text = "48000 Hz"
  102. popup/item_5/id = 5
  103. [node name="StereoLabel" type="Label" parent="."]
  104. layout_mode = 0
  105. offset_left = 33.0
  106. offset_top = 233.0
  107. offset_right = 102.0
  108. offset_bottom = 259.0
  109. text = "Stereo:"
  110. [node name="StereoCheckButton" type="CheckButton" parent="."]
  111. layout_mode = 0
  112. offset_left = 126.0
  113. offset_top = 233.0
  114. offset_right = 170.0
  115. offset_bottom = 264.0
  116. button_pressed = true
  117. [node name="SaveButton" type="Button" parent="."]
  118. layout_mode = 0
  119. offset_left = 29.0
  120. offset_top = 284.0
  121. offset_right = 159.0
  122. offset_bottom = 324.0
  123. disabled = true
  124. text = "Save WAV To:"
  125. [node name="Filename" type="LineEdit" parent="SaveButton"]
  126. layout_mode = 0
  127. offset_left = 180.0
  128. offset_right = 507.0
  129. offset_bottom = 40.0
  130. text = "user://record.wav"
  131. caret_blink = true
  132. [node name="OpenUserFolderButton" type="Button" parent="."]
  133. layout_mode = 1
  134. offset_left = 209.0
  135. offset_top = 334.0
  136. offset_right = 372.0
  137. offset_bottom = 374.0
  138. text = "Open User Folder"
  139. [connection signal="pressed" from="RecordButton" to="." method="_on_RecordButton_pressed"]
  140. [connection signal="pressed" from="PlayButton" to="." method="_on_PlayButton_pressed"]
  141. [connection signal="pressed" from="PlayMusic" to="." method="_on_Play_Music_pressed"]
  142. [connection signal="item_selected" from="FormatOptionButton" to="." method="_on_FormatOptionButton_item_selected"]
  143. [connection signal="item_selected" from="MixRateOptionButton" to="." method="_on_MixRateOptionButton_item_selected"]
  144. [connection signal="toggled" from="StereoCheckButton" to="." method="_on_StereoCheckButton_toggled"]
  145. [connection signal="pressed" from="SaveButton" to="." method="_on_SaveButton_pressed"]
  146. [connection signal="pressed" from="OpenUserFolderButton" to="." method="_on_open_user_folder_button_pressed"]