Skip to content

Instantly share code, notes, and snippets.

View aylarov's full-sized avatar

Alexey Aylarov aylarov

View GitHub Profile
@aylarov
aylarov / asr_transcription.js
Created December 16, 2016 13:31
Voximplant ASR example #1: transcription
// Without using Recording, it will transcribe both channels and create txt with the dialog
call.record({
language: ASRLanguage.ENGLISH_US,
transcribe: true,
stereo: true
});
// With Recorder module, use it if you need to transcribe only one participant of the call
require(Modules.ASR);
var recorder = VoxEngine.createRecorder({
@aylarov
aylarov / VoximplantGoogleASR.js
Last active May 27, 2020 08:03
Voximplant Speech Recognition demo. VoxEngine scenario and web client
require(Modules.ASR);
require(Modules.Player);
var mycall,
myasr,
player,
ts,
ts2,
vad = false;
// User Conference
require(Modules.Conference);
require(Modules.Player);
var conf,
user_call,
channel_calls = [],
caller_id,
display_name,
default_channel_ids;
// Channel Conference
require(Modules.Conference);
require(Modules.Player);
var conf,
calls = [];
VoxEngine.addEventListener(AppEvents.Started, function(e) {
conf = VoxEngine.createConference();
});
var username;
VoxEngine.addEventListener(AppEvents.CallAlerting, function (e) {
username = e.callerid;
var call = VoxEngine.callConference("user_" + e.callerid, e.callerid, e.displayName, e.headers);
VoxEngine.easyProcess(e.call, call, function (c1, c2) {
e.call.sendMessage(JSON.stringify({
event: "userconf_connected",
name: e.callerid
}));
@aylarov
aylarov / VoxEngine Example
Created May 6, 2016 11:07
Example for Medium post
var inbound_call;
// Incoming call has arrived
VoxEngine.addEventListener(AppEvents.CallAlerting, function (event) {
inbound_call = event.call;
// Add event listener for connected event
inbound_call.addEventListener(CallEvents.Connected, function (callevent) {
// Make http request to external webserivce to get some data
Net.httpRequest("http://domain.com/getData/?" + encodeURIComponent(inbound_call.callerid()), handleDataReceived);
});
inbound_call.addEventListener(CallEvents.Disconnected, VoxEngine.terminate);
require(Modules.Player);
require(Modules.Conference);
(function () {
var keys = [{
username: "android",
password: "AC7IBG09A3DTSYM4R41UJWL07VLN8JI7",
deviceId: "android-generic",
decrypt: "R=U!LH$O2B#",
/*
* Blowfish.js from Dojo Toolkit 1.8.1
* Cut of by Sladex (xslade@gmail.com)
*
* Usage:
* blowfish.encrypt(String 'subj to encrypt', String 'key', Object {outputType: 1, cipherMode: 0});
*
*/
@aylarov
aylarov / clicktocall.html
Created March 7, 2016 09:53
VoxImplant Web SDK: click to call
<!DOCTYPE html>
<html>
<head>
<script type="text/javascript" src="http://cdn.voximplant.com/voximplant.min.js"></script>
<script type="text/javascript">
var initialized = false,
loggedIn = false,
connected = false,
voxAPI = VoxImplant.getInstance();
@aylarov
aylarov / mic_activity.html
Created January 22, 2016 13:00
VoxImplant Web SDK: mic activity visualization
<!doctype html>
<html>
<head>
<title>VoxImplant Mic Activity Visualization Demo</title>
<script type="text/javascript" src="//cdn.voximplant.com/voximplant.min.js"></script>
</head>
<body>
<canvas id="mic_activity" width="30" height="150" style="border: solid 1px #ccc;"></canvas>
<script>
var vox = VoxImplant.getInstance();