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> | |
<title>Publish to Vonage, via Subspace TURN network</title> | |
<link href="css/app.css" rel="stylesheet" type="text/css"> | |
<script> | |
class turnSubspaceRTCPeerConnection extends RTCPeerConnection { | |
constructor(configuration) { | |
configuration.iceTransportPolicy = 'relay' | |
configuration.iceServers = [ | |
{ |
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 speech = require('@google-cloud/speech'); | |
const fs = require('fs'); | |
const logger = console; | |
class GoogleSpeech | |
{ | |
constructor() | |
{ | |
logger.debug('constructor()'); |
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
/** | |
* Copyright 2017, Google, Inc. | |
* Licensed under the Apache License, Version 2.0 (the "License"); | |
* you may not use this file except in compliance with the License. | |
* You may obtain a copy of the License at | |
* | |
* http://www.apache.org/licenses/LICENSE-2.0 | |
* | |
* Unless required by applicable law or agreed to in writing, software | |
* distributed under the License is distributed on an "AS IS" BASIS, |
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
/** | |
* Make sure you're not already authenticated with gRPC, on MacOS you need | |
* to ensure the GOOGLE_APPLICATION_CREDENTIALS environment variable is not | |
* set : `unset GOOGLE_APPLICATION_CREDENTIALS` | |
* | |
* @google-cloud/speech and google-gax are used to load the necessary .proto files | |
* | |
* I tried to add the 'key' to the request itself, or as a metadata with the request | |
* and always getting the following error from gRPC : | |
* Error: 7 PERMISSION_DENIED: The request is missing a valid API key. |
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 fs = require('fs'); | |
const axios = require('axios'); | |
const API_KEY = 'ADD YOUR API KEY HERE'; | |
const fileName = './audio.raw'; | |
// Reads a local audio file and converts it to base64 | |
const file = fs.readFileSync(fileName); | |
const audioBytes = file.toString('base64'); |
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 fs = require('fs'); | |
const { auth } = require('google-auth-library'); | |
const API_KEY = 'ADD YOUR API KEY HERE'; | |
const fileName = './audio.raw'; | |
// Reads a local audio file and converts it to base64 | |
const file = fs.readFileSync(fileName); | |
const audioBytes = file.toString('base64'); |