Skip to content

Instantly share code, notes, and snippets.

@lynsei
Created April 24, 2022 16:58
Show Gist options
  • Save lynsei/a31ec0c0de6f710b49cd49d2828641ff to your computer and use it in GitHub Desktop.
Save lynsei/a31ec0c0de6f710b49cd49d2828641ff to your computer and use it in GitHub Desktop.
[microsoft edge text-to-speech api] through #rapid #api #text #to #speech #apis

TTS Text to Speech

  • Microsoft Edge API Service
  • 5000 requests per day max.
  • Uses RAPIDAPI.com
  • Set up to use node-fetch module and NodeJS

Link to RapidAPI

const fetch = require('node-fetch');

// Are you friends with any police officers (prompt) response:
const url = 'https://microsoft-edge-text-to-speech.p.rapidapi.com/TTS/EdgeTTS?text=No.%20%20Transgender%20people%20actually%20dislike%20police%20officers%20because%20they%20are%20not%20super%20nice%20to%20us.&voice_name=en-US-AriaNeural';

const options = {
  method: 'GET',
  headers: {
    'X-RapidAPI-Host': '',
    'X-RapidAPI-Key': ''
  }
};

fetch(url, options)
	.then(res => res.json())
	.then(json => console.log(json))
	.catch(err => console.error('error:' + err));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment