mirror of
https://github.com/DJ2LS/FreeDATA
synced 2024-05-14 10:04:33 +02:00
waiting for buffer
it seems we need to wait a little bit for our modulation data. There are some moments where audio output is stuck a little bit. Maybe python is sometimes faster than the buffer allocation or its a threading problem
This commit is contained in:
parent
88a0628b53
commit
3501b4f952
|
@ -646,7 +646,6 @@ ipcRenderer.on('action-update-tnc-state', (event, arg) => {
|
|||
}
|
||||
|
||||
// BEACON STATE
|
||||
console.log(arg.beacon_state)
|
||||
if (arg.beacon_state == 'True') {
|
||||
document.getElementById("startBeacon").className = "btn btn-success spinner-grow"
|
||||
document.getElementById("startBeacon").disabled = true
|
||||
|
|
|
@ -617,6 +617,8 @@ def burst_rpt_received(data_in):
|
|||
|
||||
def open_dc_and_transmit(data_out, mode, n_frames_per_burst):
|
||||
global DATA_CHANNEL_READY_FOR_DATA
|
||||
|
||||
static.TNC_STATE = 'BUSY'
|
||||
|
||||
asyncio.run(arq_open_data_channel(mode))
|
||||
# wait until data channel is open
|
||||
|
|
|
@ -242,8 +242,9 @@ class RF():
|
|||
|
||||
# write preamble to txbuffer
|
||||
codec2.api.freedv_rawdatapreambletx(freedv, mod_out_preamble)
|
||||
time.sleep(0.01)
|
||||
txbuffer += bytes(mod_out_preamble)
|
||||
|
||||
|
||||
# create modulaton for n frames in list
|
||||
for n in range(0,len(frames)):
|
||||
|
||||
|
@ -259,19 +260,19 @@ class RF():
|
|||
|
||||
data = (ctypes.c_ubyte * bytes_per_frame).from_buffer_copy(buffer)
|
||||
codec2.api.freedv_rawdatatx(freedv,mod_out,data) # modulate DATA and save it into mod_out pointer
|
||||
|
||||
time.sleep(0.01)
|
||||
txbuffer += bytes(mod_out)
|
||||
|
||||
|
||||
# append postamble to txbuffer
|
||||
codec2.api.freedv_rawdatapostambletx(freedv, mod_out_postamble)
|
||||
txbuffer += bytes(mod_out_postamble)
|
||||
|
||||
time.sleep(0.01)
|
||||
# add delay to end of frames
|
||||
samples_delay = int(self.MODEM_SAMPLE_RATE*(repeat_delay/1000))
|
||||
mod_out_silence = create_string_buffer(samples_delay*2)
|
||||
txbuffer += bytes(mod_out_silence)
|
||||
|
||||
time.sleep(0.01)
|
||||
|
||||
# resample up to 48k (resampler works on np.int16)
|
||||
x = np.frombuffer(txbuffer, dtype=np.int16)
|
||||
|
|
Loading…
Reference in a new issue