java - Set request property content type to raw byte data? -


i have httpurlconnection send audio to. use

setrequestproperty("content-type", "audio/x-flac; rate=48000"); 

to specify type of audio sending. supposed receive string of whatever audio file says.

it works when byte array of audio file , send want able send audio taken microphone byte array don't know how specify that.

or send wav file tried test file using "audio/wav" , still doesn't work.

the error when doesn't work is

java.io.ioexception: server returned http response code: 500 url: https://www.google.com/speech-api/v1/recognize?xjerr=1&client=speech2text&lang=en-us&maxresults=10 

the line refers

connection.getinputstream(); 

thanks.


Comments

Popular posts from this blog

java.util.scanner - How to read and add only numbers to array from a text file -

rewrite - Trouble with Wordpress multiple custom querystrings -