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
|
@ -45,7 +45,6 @@ window.addEventListener('DOMContentLoaded', () => {
|
||||||
let Data = {
|
let Data = {
|
||||||
type: "set",
|
type: "set",
|
||||||
command: "record_audio",
|
command: "record_audio",
|
||||||
state: "True",
|
|
||||||
};
|
};
|
||||||
ipcRenderer.send('run-tnc-command', Data);
|
ipcRenderer.send('run-tnc-command', Data);
|
||||||
|
|
||||||
|
@ -2105,6 +2104,9 @@ ipcRenderer.on('run-tnc-command', (event, arg) => {
|
||||||
if (arg.command == 'set_tx_audio_level') {
|
if (arg.command == 'set_tx_audio_level') {
|
||||||
sock.setTxAudioLevel(arg.tx_audio_level);
|
sock.setTxAudioLevel(arg.tx_audio_level);
|
||||||
}
|
}
|
||||||
|
if (arg.command == 'record_audio') {
|
||||||
|
sock.record_audio();
|
||||||
|
}
|
||||||
if (arg.command == 'send_test_frame') {
|
if (arg.command == 'send_test_frame') {
|
||||||
sock.sendTestFrame();
|
sock.sendTestFrame();
|
||||||
}
|
}
|
||||||
|
|
|
@ -586,7 +586,11 @@ exports.sendTestFrame = function() {
|
||||||
writeTncCommand(command)
|
writeTncCommand(command)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// RECORD AUDIO
|
||||||
|
exports.record_audio = function() {
|
||||||
|
command = '{"type" : "set", "command" : "record_audio"}'
|
||||||
|
writeTncCommand(command)
|
||||||
|
}
|
||||||
|
|
||||||
ipcRenderer.on('action-update-tnc-ip', (event, arg) => {
|
ipcRenderer.on('action-update-tnc-ip', (event, arg) => {
|
||||||
client.destroy();
|
client.destroy();
|
||||||
|
|
|
@ -230,8 +230,8 @@ def process_tnc_commands(data):
|
||||||
# START STOP AUDIO RECORDING -----------------------------------------------------
|
# START STOP AUDIO RECORDING -----------------------------------------------------
|
||||||
if received_json["type"] == "set" and received_json["command"] == "record_audio":
|
if received_json["type"] == "set" and received_json["command"] == "record_audio":
|
||||||
try:
|
try:
|
||||||
if received_json["state"] in ['true', 'True', True]:
|
if not static.AUDIO_RECORD:
|
||||||
static.AUDIO_RECORD_FILE = open(f"{int(time.time())}_audio_recording", 'wb')
|
static.AUDIO_RECORD_FILE = open(f"{int(time.time())}_audio_recording.raw", 'wb')
|
||||||
static.AUDIO_RECORD = True
|
static.AUDIO_RECORD = True
|
||||||
else:
|
else:
|
||||||
static.AUDIO_RECORD = False
|
static.AUDIO_RECORD = False
|
||||||
|
|
Loading…
Reference in a new issue