def ToggleRecording(BUTTONCONF): RecordOn = True try: #Here we try to turn the recording on if str(ws.call(requests.StartRecording())) != "<StartRecording request ({}) called: failed ({'error': 'recording already active'})>": print("Recording started") RecordOn = False #Here we turn the Led on the midi pad on try: if "Led" in BUTTONCONF: if "LedMode" in BUTTONCONF: midi_out.write_short(0x90, BUTTONCONF["Led"], BUTTONCONF["LedMode"]) else: print("No LedMode argument in Button config") else: print("No Led argument in Button config") except: pass except: pass #Here we try to turn the recording off if the first try failed if RecordOn == True: try: ws.call(requests.StopRecording()) print("Recording stopped") #Here we turn the Led on the midi pad off try: if "Led" in BUTTONCONF: midi_out.write_short(0x90, BUTTONCONF["Led"], 0) else: print("No Led argument in Button config") except: pass except: print("Recording couldn't be toggled")
async def start_(self, ctx: Context): """ Начало трансляции. Аналог resume но без подсчёта зрителей %%start """ if not self.bot.check_sender(ctx, 'iarspider'): asyncio.ensure_future( ctx.send('/timeout ' + ctx.author.name + ' 1')) return # self.get_player() # self.player_play_pause() if self.ws is not None: if self.vr: self.switch_to('VR Game') self.ws.call( obsws_requests.SetMute(self.aud_sources.getMic2(), False)) else: self.switch_to('Game') self.ws.call( obsws_requests.SetMute(self.aud_sources.getMic1(), False)) self.ws.call(obsws_requests.SetMute(True, 'Радио')) self.ws.call(obsws_requests.StartRecording())
def recordingControl(address): controlType = removePrefix(address, '/recording/') if controlType == 'start': ws.call(requests.StartRecording()) elif controlType == 'stop': ws.call(requests.StopRecording()) elif controlType == 'toggle': ws.call(requests.StartStopRecording())
def set_record(self, val=None): if val is None: val = not self.connection.call( requests.GetStreamingStatus()).getRecording() if val == True: self.connection.call(requests.StartRecording()) else: self.connection.call(requests.StopRecording())
def TurnRecordingOn(): try: Response = str(ws.call(requests.StartRecording())) except: PrintError("Recording can't be turned on") else: if Response == "<StartRecording request ({}) called: failed ({'error': 'recording already active'})>": PrintError("Recording can't be turned on") else: MidiLed(Action, "on") PrintWithTime("Recording started")
def ToggleRecording(Action, ws, midi_out): try: Response = str(ws.call(requests.StartRecording())) except: print("Recording can't be toggled") else: if Response == "<StartRecording request ({}) called: failed ({'error': 'recording already active'})>": try: ws.call(requests.StopRecording()) except: print("Couldn't turn recording off") else: MidiLed(Action, "off", midi_out) PrintWithTime("Recording stopped") elif Response == "<StartRecording request ({}) called: success ({})>": MidiLed(Action, "on", midi_out) PrintWithTime("Recording started") else: print("Couldn't toggle recording")
def rec_cb(values): if values > 0.0: self.client.call(requests.StartRecording()) else: self.client.call(requests.StopRecording()) self.osc.answer('/rec', [values])
def StartRecording(self): try: self.ws.call(requests.StartRecording()) except Exception as e: print(e)
def start_record(self): if self.is_recording(): return True res = self._call(requests.StartRecording()) return res.status
mouse_listener.start() def on_press(key): add_time_to_deque() def on_release(key): add_time_to_deque() keyboard_listener = keyboard.Listener(on_press=on_press, on_release=on_release) keyboard_listener.start() if __name__ == "__main__": ws.call(requests.StartRecording()) while True: time.sleep(1) if checkIfDequeTimeLargerThanCurrentTimeBy(5): isInMoving = False else: isInMoving = True print(isInMoving) if isInMoving: ws.call(requests.ResumeRecording()) else: ws.call(requests.PauseRecording())
def StartRecording(self, *args): return self.ws.call(requests.StartRecording())
async def start(): myOBScall(requests.StartRecording()) return {"message": "done"}
def Recording_Start(self, *args, **kwargs): try: self.ws.call(requests.StartRecording()) PrintWithTime(f"Started recording") except Exception as e: PrintWithTime(f"Couldn't start recording. Error : {e}")