Explorar o código

fixed issue with window count being mis-calculated when overlap is changed

Jonathan Higgins hai 1 mes
pai
achega
2ebbd9e927
Modificáronse 2 ficheiros con 8 adicións e 1 borrados
  1. 1 1
      export_presets.cfg
  2. 7 0
      scenes/main/scripts/run_thread.gd

+ 1 - 1
export_presets.cfg

@@ -76,7 +76,7 @@ custom_features=""
 export_filter="all_resources"
 include_filter="*.thd, export_presets.cfg"
 exclude_filter=""
-export_path="../SoundThread_Exports/v0-3-1-beta/SoundThread-v0-3-1-beta_macos.zip"
+export_path="../SoundThread_Exports/v0-3-1-beta/v0-3-1-beta_macos.zip"
 patches=PackedStringArray()
 encryption_include_filters=""
 encryption_exclude_filters=""

+ 7 - 0
scenes/main/scripts/run_thread.gd

@@ -889,12 +889,18 @@ func get_analysis_file_properties(file: String) -> Dictionary:
 			
 	#close the file
 	f.close()
+	
+	#calculate actual window size from the decimation factor
+	
+	analysis_file_properties["windowsize"] = analysis_file_properties["windowsize"] * 128 / analysis_file_properties["decimationfactor"]
+	
 	if analysis_file_properties["windowsize"] != 0 and data_chunk_size != 0:
 		var bytes_per_frame = (analysis_file_properties["windowsize"] + 2) * 4
 		analysis_file_properties["windowcount"] = int(data_chunk_size / bytes_per_frame)
 	else:
 		log_console("Error: Could not get information from analysis file", true)
 		
+	print(analysis_file_properties)
 	return analysis_file_properties
 	
 func hex_string_to_int_le(hex_string: String) -> int:
@@ -907,6 +913,7 @@ func hex_string_to_int_le(hex_string: String) -> int:
 		le_string += hex_string.substr(i, 2)
 	
 	return le_string.hex_to_int()
+	
 
 func merge_many_files(inlet_id: int, process_count: int, input_files: Array) -> Array:
 	var merge_output = "%s_merge_%d_%d.wav" % [Global.outfile.get_basename(), inlet_id, process_count]