wit-ai / wit

Natural Language Interface for apps and devices
https://wit.ai/
942 stars 91 forks source link

{ "error" : "Speech recognition is not supported for language: Persian", "code" : "bad-request" } #1537

Closed nimaftf closed 5 years ago

nimaftf commented 5 years ago

I see your product support Persian languge in voicy bot in telegram. Why I cant use it. Please help me. { "error" : "Speech recognition is not supported for language: Persian", "code" : "bad-request" }

nimaftf commented 5 years ago

Hi First of all, I'm sorry that I'm taking your time. This is not really an issue with this bot, it's a question I had. The thing is, this bot supports Persian TTS but the problem is when I try wit.ai as an API for my project, this is the response I get:

{ "error" : "Speech recognition is not supported for language: Persian", "code" : "bad-request" }

I'm using POST method for speech using the following command in terminal:

curl -XPOST 'https://api.wit.ai/speech?v=20170307' -i -L -H "Authorization: Bearer $MYTOKEN" -H "Content-Type: audio/mpeg3" --data-binary "@sample.mp3"

I just replace $MYTOKEN with my real token that I got in the app. so my question is, how did you do that?

nimaftf commented 5 years ago

$request = curl_init('https://api.wit.ai/speech?context=%7B%22locale%22%3A%22fa_IR%22%7D'); $headers[] = 'Authorization: Bearer BETxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx4UF2'; $headers[] = 'Content-Type: audio/wav';

curl_setopt($request, CURLOPT_CUSTOMREQUEST, "POST");

curl_setopt($request, CURLOPT_POSTFIELDS, file_get_contents("dolar.wav")); curl_setopt($request, CURLOPT_HTTPHEADER, $headers); curl_setopt($request, CURLOPT_RETURNTRANSFER, true); $return = curl_exec($request); echo $return; curl_close($request);

this is my code in php

jtliao commented 5 years ago

What is your app ID? The language is currently under limited access.

mbtolou commented 5 years ago

hello my friend can you help me to activate my application api ? app id : 2673171512716681

jtliao commented 5 years ago

done