This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function hangup() { | |
console.log('Ending call'); | |
pc1.close(); | |
pc2.close(); | |
pc1 = null; | |
pc2 = null; | |
hangupButton.disabled = true; | |
callButton.disabled = false; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const configuration = getSelectedSdpSemantics(); | |
console.log('RTCPeerConnection configuration:', configuration); | |
pc1 = new RTCPeerConnection(configuration); | |
console.log('Created local peer connection object pc1'); | |
pc1.addEventListener('icecandidate', e => onIceCandidate(pc1, e)); | |
pc2 = new RTCPeerConnection(configuration); | |
console.log('Created remote peer connection object pc2'); | |
pc2.addEventListener('icecandidate', e => onIceCandidate(pc2, e)); | |
pc1.addEventListener('iceconnectionstatechange', e => onIceStateChange(pc1, e)); | |
pc2.addEventListener('iceconnectionstatechange', e => onIceStateChange(pc2, e)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
async function call() { | |
callButton.disabled = true; | |
hangupButton.disabled = false; | |
console.log('Starting call'); | |
startTime = window.performance.now(); | |
const videoTracks = localStream.getVideoTracks(); | |
const audioTracks = localStream.getAudioTracks(); | |
if (videoTracks.length > 0) { | |
console.log(`Using video device: ${videoTracks[0].label}`); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
async function start() { | |
console.log('Requesting local stream'); | |
startButton.disabled = true; | |
try { | |
const stream = await navigator.mediaDevices.getUserMedia({audio: true, video: true}); | |
console.log('Received local stream'); | |
localVideo.srcObject = stream; | |
localStream = stream; | |
local_Video.srcObject = stream; | |
callButton.disabled = false; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function close(){ | |
client.unpublish(localstream, function(err) { | |
console.log("unpublished!"); | |
//…… | |
}) | |
client.leave(function() { | |
console.log("client leaves channel"); | |
//…… | |
}, function(err) { | |
console.log("client leave failed ", err); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function myfunction(){ | |
let handlefail = function(err){ | |
console.log("Error: ", err); | |
}; | |
let remotecontainer = document.getElementById("remote"); | |
let appid = document.getElementById("appid"); | |
function addremotestream(streamid){ | |
let newdiv = document.createElement("div"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var config = { | |
mode: "live", | |
codec: "h264" | |
} | |
var client = AgoraRTC.createClient(config); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
Contains variables for image-size, path of models and labels that are required by other modules | |
""" | |
IMAGE_SIZE = 50 # We'll be working with 50 * 50 pixel images | |
MODEL_PATH = "trained_model/bglessmodelv1.h5" | |
LABELS = ['A', 'C', 'E', 'H', 'I', 'L', 'O', 'U', 'V', 'W'] | |
# Minimum confidence percentage i.e allowed for prediction | |
THRESHOLD = 30 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
Contains functions : pre_process() and which() that are needed by translator.py for predicting image from webcam | |
""" | |
import cv2 | |
import numpy as np | |
from variables import * | |
from keras.models import load_model | |
# Loads pretrained CNN Model from MODEL_PATH |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Speak the sentence | |
if len(sentence) > 0 and c == ord('s'): | |
engine.say(sentence) | |
engine.runAndWait() | |
# Clear the sentence | |
if c == ord('c') or c == ord('C'): | |
sentence = "" | |
# Delete the last character | |
if c == ord('d') or c == ord('D'): | |
sentence = sentence[:-1] |