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
public byte[] increaseVolume(byte[] audioBuffer) { | |
for (int i = 0; i < audioBuffer.length; i += 2) { | |
// Convert 16-bit little-endian PCM samples to a short | |
short sample = (short)((audioBuffer[i] & 0xFF) | (audioBuffer[i + 1] << 8)); | |
// Increase the volume by 10% | |
sample = (short)(sample * 1.1); | |
// Clip the value to stay within the 16-bit range | |
if (sample > Short.MAX_VALUE) { |
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 express = require('express') | |
var bodyParser = require('body-parser') | |
const uuid = require("uuid") | |
const jwt = require("jsonwebtoken") | |
const request = require('request'); | |
const fs = require('fs') | |
const app = express() | |
app.use(bodyParser.json()) | |
app.use(bodyParser.urlencoded({ extended: false })) | |
const app_id="39dc9665-f65e-4764-92d3-715aa98b3f55"; |
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
#!/bin/bash | |
generate_podfile(){ | |
echo "platform :ios, '12.0' | |
install! 'cocoapods', integrate_targets: false | |
use_frameworks! | |
pod 'OTXCFramework', '$1' | |
" > Podfile |
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
location /proxy/ { | |
if ($request_method = OPTIONS ) { | |
add_header Allow "POST, GET, OPTIONS"; | |
add_header Access-Control-Allow-Headers "*"; | |
add_header Access-Control-Allow-Origin "*"; | |
return 200; | |
} | |
resolver 8.8.8.8 ipv6=off; | |
rewrite /proxy/(?:https?:\/\/)?(?:[^@\/\n]+@)?(?:www\.)?([^\/?\n]+)(.+) $2 break; |
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
// | |
// DefaultAudioDevice.swift | |
// 4.Custom-Audio-Driver | |
// | |
// Created by Roberto Perez Cubero on 21/09/2016. | |
// Copyright © 2016 tokbox. All rights reserved. | |
// | |
import Foundation | |
import OpenTok |
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
app.get("/answer", function (req, res) { | |
console.log("uuid is:"+req.query.uuid); | |
var ncco = [ | |
{ | |
action: "conversation", | |
name: "conf"+req.query.uuid , | |
startOnEnter: true, | |
record: true | |
} |
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
1. sendScreenShot (front-end js) method uses subsciber.getImgData() method to capture screenshot of the subscriber (remote participant) and post it to the server. | |
2. On the server we use detectFace() method to detect the facial features in this image and we get a identifier for the detected face (id1) | |
3. we use detectFace() again with the image we want to compare with and we get identifier for the detected face (id2) | |
4. we use verifyFace() method and pass id1 and id2 as the inputs. Microsoft face API compares these two faces and provides a result that includes match/mismatch as well as a score. | |
Reference - | |
1. getImgData() - https://tokbox.com/developer/sdks/js/reference/Subscriber.html#getImgData | |
2. Microsoft Face API - https://westus.dev.cognitive.microsoft.com/docs/services/563879b61984550e40cbbe8d/operations/563879b61984550f30395236 | |
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
<html> | |
<head> | |
<script src="https://static.opentok.com/v2/js/opentok.min.js"></script> | |
</head> | |
<body> | |
<audio crossOrigin="anonymous" id="mp3file" controls> | |
<source src="helix.mp3"/> | |
</audio> | |
<div id="layoutContainer"></div> | |
<button onclick="startProcess()">Let the magic begin</button> |