more audio related work

This commit is contained in:
dj2ls 2024-04-01 11:05:21 +02:00
parent 8fbc9856db
commit 0be52c4948
3 changed files with 5 additions and 5 deletions

View file

@ -166,6 +166,7 @@ class ARQSessionISS(arq_session.ARQSession):
self.confirmed_bytes = self.total_length
elif not fallback:
self.confirmed_bytes = self.expected_byte_offset
self.log(f"IRS confirmed {self.confirmed_bytes}/{self.total_length} bytes")
# check if we received an abort flag

View file

@ -225,7 +225,6 @@ def calculate_fft(data, fft_queue, states) -> None:
global RMS_COUNTER, CHANNEL_BUSY_DELAY
try:
fftarray = np.fft.rfft(data)
# Set value 0 to 1 to avoid division by zero
@ -322,8 +321,8 @@ def calculate_fft(data, fft_queue, states) -> None:
# erase queue if greater than 3
if fft_queue.qsize() >= 1:
fft_queue = queue.Queue()
#fft_queue.put(dfftlist[:315]) # 315 --> bandwidth 3200
fft_queue.put(dfftlist) # 315 --> bandwidth 3200
fft_queue.put(dfftlist[:315]) # 315 --> bandwidth 3200
#fft_queue.put(dfftlist) # 315 --> bandwidth 3200
except Exception as err:
print(f"[MDM] calculate_fft: Exception: {err}")

View file

@ -162,7 +162,7 @@ class RF:
callback=self.sd_output_audio_callback,
device=out_dev_index,
samplerate=self.AUDIO_SAMPLE_RATE,
blocksize=512,
blocksize=600,
)
self.sd_output_stream.start()
@ -259,7 +259,7 @@ class RF:
self.tci_module.wait_until_transmitted(audio_48k)
else:
# slice audio data to needed blocklength
block_size = 512
block_size = self.sd_output_stream.blocksize
pad_length = -len(audio_48k) % block_size
padded_data = np.pad(audio_48k, (0, pad_length), mode='constant')
sliced_audio_data = padded_data.reshape(-1, block_size)