Coder Social home page Coder Social logo

cURL - data binary about unirest-nodejs HOT 1 OPEN

ulymarins avatar ulymarins commented on August 20, 2024
cURL - data binary

from unirest-nodejs.

Comments (1)

hexnano avatar hexnano commented on August 20, 2024

Hello I encountered the same problem with a different voice API wit.ai, I solved the problem by setting params=( open("/home/pi/Downloads/sample.wav") )
sample code below

import subprocess, os, sys, unirest, time
print ("Recording")
#a1 = "arecord -d 2 -D plughw:1,0 -r 16000 -f S16_LE sample.wav"
#subprocess.call(a1,shell= True)
print ("Done")

response = unirest.post("https://api.wit.ai/speech?v=20160526",
headers={
"Authorization": "Bearer JIAK5Q5KOHEBZEBREPDLVM3ILPGNJYFE",
"Content-Type": "audio/wav",
"Content-Length": "40000",
},
params=(

open("/home/pi/Downloads/sample.wav")
)
)
time.sleep(2)
print" ===========after sleep"
print str(response.code)
print"response.code"
print str(response.headers)
print" response.headers"
print str(response.body)
x = str(response.body)
print" response.body"
print str(response.raw_body)

from unirest-nodejs.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.