diff options
author | sotech117 <michael_foiani@brown.edu> | 2023-12-14 22:01:53 -0500 |
---|---|---|
committer | sotech117 <michael_foiani@brown.edu> | 2023-12-14 22:01:53 -0500 |
commit | b8ab1e8abf56ccaabff8b9414d9d64a151079a1b (patch) | |
tree | f1ac4ec96b5513c56c6cb955df35ea595bd479d1 /utils.py | |
parent | d7384329b2ae615ef7d637e31f214dbe648ae418 (diff) |
fix merge
Diffstat (limited to 'utils.py')
-rw-r--r-- | utils.py | 10 |
1 files changed, 3 insertions, 7 deletions
@@ -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' |