Skip to content

Commit

Permalink
fix: update Wit Speech API
Browse files Browse the repository at this point in the history
  • Loading branch information
dessant committed May 14, 2020
1 parent b8ae56f commit d244f62
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/background/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ async function getWitSpeechApiKey(speechService, language) {
}

async function getWitSpeechApiResult(apiKey, audioContent) {
const rsp = await fetch('https://api.wit.ai/speech', {
const rsp = await fetch('https://api.wit.ai/speech?v=20200513', {
referrer: '',
mode: 'cors',
method: 'POST',
Expand All @@ -244,7 +244,7 @@ async function getWitSpeechApiResult(apiKey, audioContent) {
throw new Error(`API response: ${rsp.status}, ${await rsp.text()}`);
}

return (await rsp.json())._text.trim();
return (await rsp.json()).text.trim();
}

async function getIbmSpeechApiResult(apiUrl, apiKey, audioContent, language) {
Expand Down

0 comments on commit d244f62

Please sign in to comment.