Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeError(repr(o) + " is not JSON serializable") #7

Open
alatriste-lee opened this issue Sep 22, 2016 · 1 comment
Open

TypeError(repr(o) + " is not JSON serializable") #7

alatriste-lee opened this issue Sep 22, 2016 · 1 comment

Comments

@alatriste-lee
Copy link

self.request = Request(url, data = json.dumps(data), headers = {"Content-Type": "application/json"})

json.dumps(data)

@makelove
Copy link

makelove commented Nov 11, 2016

也碰到这个问题。
不过我改了代码。百度的post data规格改了。
data = {
"format": "pcm",
# "lan": self.language,
"token": self.token,
"len": len(audio_data.data),
# "rate": audio_data.rate,
"rate": 8000,
"channel" : 1,
"speech": base64.b64encode(audio_data.data),
"cuid": '93489083242',
}

不过出现另外一个问题
with sr.WavFile(WAV_FILE) as source:
audio = r.record(source) # read the entire WAV file
读不出数据!!!
audio为空!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants