aboutsummaryrefslogtreecommitdiff
path: root/utils.py
diff options
context:
space:
mode:
Diffstat (limited to 'utils.py')
-rw-r--r--utils.py10
1 files changed, 3 insertions, 7 deletions
diff --git a/utils.py b/utils.py
index 503d289..077fe8d 100644
--- a/utils.py
+++ b/utils.py
@@ -30,11 +30,6 @@ def wave_to_bits(wave, starting_freq, freq_range, bytes_per_transmit, chunk=4096
# convert the frequencies to bits
data = frequencies_to_bits(freqs, calculate_send_frequencies(starting_freq, freq_range, bytes_per_transmit))
- # TODO: remove
- byte = data[:8]
- if data[-1] == '1':
- receive_string(byte)
-
return data
@@ -68,7 +63,7 @@ def frequencies_to_bits(frequencies, expected_freqs):
def play_data(data, start_freq, freq_step, bytes_per_transmit, stream):
freq_list = calculate_send_frequencies(start_freq, freq_step, bytes_per_transmit)
- send_duration = 1.0
+ send_duration = .25
flip_flag = 0 # TODO: make this global between plays
for byte in data:
@@ -94,4 +89,5 @@ def receive_string(binary):
print(chr(int(binary_string, 2)))
return chr(int(binary_string, 2))
except ValueError:
- print("Error: Invalid binary data")
+ print("Warn: Invalid binary data: ", binary_string)
+ return 'X'