Exemplo n.º 1
0
def call():
    myInput = control.getUserInput()
    global waitingForCall
    global callInProgress
    controlEnd = LCD_Control(LCD)
    if waitingForCall:
        waitingForCall = False
        #talk()
        talker = threading.Thread(target=talk)
        talker.start()
        myInput = controlEnd.getUserInput()
        callInProgress = False
        print("call ended")
    else:
        print("call ended")
        callInProgress = False
    print("call stopped")
Exemplo n.º 2
0
    Listen_CHUNK = 168
    CHANNELS = 1
    RATE = 48000
    WIDTH = 2

    oc = OpusCodec()

    #network
    Listener_HOST = fatmanIP  # the remote host
    Listener_PORT = 50008  # the same port as used by the server
    # global variable to see whether call was made or received
    waitingForCall = True
    # global variable to see if call has finished
    callInProgress = True
    # Initializing LCD control
    control = LCD_Control(LCD)

    listener_stream = 0
    jitter_buf = Queue()

    writer = threading.Thread(target=write_to_stream)

    listener = threading.Thread(target=listen)
    listener.start()
    caller = threading.Thread(target=call)
    caller.start()

    while (callInProgress):
        nonceInt = int.from_bytes(nonce, byteorder='little')
        nonceInt = nonceInt + 2
        nonce = nonceInt.to_bytes(24, byteorder='little')
Exemplo n.º 3
0
    RATE = 48000  #24000#48000 #24000 is also ok, but need to change opus.py if changed
    WIDTH = 2

    oc = OpusCodec()  #ALSA 7843 underrun causing static?

    #silence = chr(0)*Listen_CHUNK

    #network
    Listener_HOST = fatmanIP  #littleboyIP #'172.23.39.163'#'172.23.48.9'#'127.0.0.1'#'192.168.1.19'    # The remote host
    Listener_PORT = 50008  #50007#23555#50007              # The same port as used by the server
    #global variable to see whether call was made or received
    waitingForCall = True
    #global variable to see if call has finished
    callInProgress = True
    #Initializing LCD control
    control = LCD_Control(LCD)

    listener_stream = 0
    jitter_buf = Queue()

    writer = threading.Thread(target=write_to_stream)

    listener = threading.Thread(target=listen)
    listener.start()
    caller = threading.Thread(target=call)
    caller.start()

    while (callInProgress):
        time.sleep(5)
    print("program restarted")