mirror of
https://github.com/DJ2LS/FreeDATA
synced 2024-05-14 08:04:33 +00:00
record audio update
This commit is contained in:
parent
c0e4f14da0
commit
7691ba09ac
3 changed files with 10 additions and 4 deletions
|
@ -45,7 +45,6 @@ window.addEventListener('DOMContentLoaded', () => {
|
|||
let Data = {
|
||||
type: "set",
|
||||
command: "record_audio",
|
||||
state: "True",
|
||||
};
|
||||
ipcRenderer.send('run-tnc-command', Data);
|
||||
|
||||
|
@ -2105,6 +2104,9 @@ ipcRenderer.on('run-tnc-command', (event, arg) => {
|
|||
if (arg.command == 'set_tx_audio_level') {
|
||||
sock.setTxAudioLevel(arg.tx_audio_level);
|
||||
}
|
||||
if (arg.command == 'record_audio') {
|
||||
sock.record_audio();
|
||||
}
|
||||
if (arg.command == 'send_test_frame') {
|
||||
sock.sendTestFrame();
|
||||
}
|
||||
|
|
|
@ -586,7 +586,11 @@ exports.sendTestFrame = function() {
|
|||
writeTncCommand(command)
|
||||
}
|
||||
|
||||
|
||||
// RECORD AUDIO
|
||||
exports.record_audio = function() {
|
||||
command = '{"type" : "set", "command" : "record_audio"}'
|
||||
writeTncCommand(command)
|
||||
}
|
||||
|
||||
ipcRenderer.on('action-update-tnc-ip', (event, arg) => {
|
||||
client.destroy();
|
||||
|
|
|
@ -230,8 +230,8 @@ def process_tnc_commands(data):
|
|||
# START STOP AUDIO RECORDING -----------------------------------------------------
|
||||
if received_json["type"] == "set" and received_json["command"] == "record_audio":
|
||||
try:
|
||||
if received_json["state"] in ['true', 'True', True]:
|
||||
static.AUDIO_RECORD_FILE = open(f"{int(time.time())}_audio_recording", 'wb')
|
||||
if not static.AUDIO_RECORD:
|
||||
static.AUDIO_RECORD_FILE = open(f"{int(time.time())}_audio_recording.raw", 'wb')
|
||||
static.AUDIO_RECORD = True
|
||||
else:
|
||||
static.AUDIO_RECORD = False
|
||||
|
|
Loading…
Reference in a new issue