Comments (11)
I'm glad you got good results for the first ones :)
Note you do not need the "alexa" prefix when using this tool - Alexa Voice Service assumes that by the point the audio is uploaded the wake word has already occurred. Try removing that and see if that helps.
Can you please share two of the affected wav files so I can debug. Thanks.
from alexa-voice-service-client.
I tried to remove the "Alexa", it didn't help. Actually, it's worse. Only 5 of them give a legit response now.
Here is the link to all the audio files https://drive.google.com/drive/folders/1GQ_XM5P2-qz5SGMhG6rhJn-RjyS0V8BB?usp=sharing
from alexa-voice-service-client.
for "heads up" I get the response "hmm. I do not know that one"
for "twenty questions" it says "here's twenty questions from the games trivia..."
so for me the response is not empty.
what does your code look like? mine looks like this:
alexa_client = AlexaVoiceServiceClient(
client_id='...',
secret='...',
refresh_token='...',
)
alexa_client.connect() # authenticate and other handshaking steps
with open('/home/richtier/Downloads/test.wav', 'rb') as f:
alexa_response_audio = alexa_client.send_audio_file(f)
with open('./output.wav', 'wb') as f:
f.write(alexa_response_audio)
from alexa-voice-service-client.
I wrote a wrapper for a client.
For
1f8f273eea381aad4bbd8aa9f563409b.wav: "Open Heads Up! and play Superstars",
548d7b9c60a699410f23168e48e52285.wav: "Play Geo Quiz",
e96466b699d20f65d8d147d751c00379.wav: "Ask Baby Groot what time is it",
My response are just empty.
Others give me legit response.
When I test with the Alexa test tools. I type "Ask baby groot what time is it". Following are the response. Is it possible that this implementation only receives the first response, but sometimes Alexa returns several response for just one question. The same with "Play Geo Quiz"
from avs_client import AlexaVoiceServiceClient
class Alexa:
def __init__(self, product_id, client_id, client_secret, refresh_token):
self.product_id = product_id
self.client_id = client_id
self.client_secret = client_secret
self.refresh_token = refresh_token
self.alexa_client = AlexaVoiceServiceClient(self.client_id, self.client_secret, self.refresh_token)
self.alexa_client.connect()
def talk(self, voice_path, response_path=None):
with open(voice_path, 'rb') as f:
alexa_response_audio = self.alexa_client.send_audio_file(f)
if response_path is not None and alexa_response_audio is not None:
with open(response_path, 'wb') as f:
f.write(alexa_response_audio)
print('Saved')
else:
print('Not Saved')
from alexa-voice-service-client.
ah yes - the client does not support multiple responses yet. It currently just returns the first one.
you can stick a breakpoint here to see if this is the cause: check what parsed.parts
contains.
from alexa-voice-service-client.
Let me try to work on it. Not sure if Hyper supports Server Push now.
from alexa-voice-service-client.
requirements.txt pins Hyper to a specific version, so we're unaffected by removal of breaking changes in future versions of Hyper.
from alexa-voice-service-client.
@bayescram any progress debugging this?
from alexa-voice-service-client.
This problem is because this implementation only receives 1 response. I made some changes around the breakpoint you made. Basically, accept all responses and return a list.
from alexa-voice-service-client.
That's great, thanks. I've left some comments on the Pull Request. Let me know if you need assistance with the points raised in the feedback.
from alexa-voice-service-client.
multiple audio responses are now supported
with latest version you can do
from avs_client import AlexaVoiceServiceClient
alexa_client = AlexaVoiceServiceClient(
client_id='my-client-id',
secret='my-secret',
refresh_token='my-refresh-token',
)
alexa_client.connect() # authenticate and other handshaking steps
with open('./tests/resources/alexa_play_twenty_questions.wav', 'rb') as f:
for directive in alexa_client.send_audio_file(f):
if directive.name == 'Speak':
with open(f'./{directive.content_id}.mp3', 'wb') as f:
f.write(directive.audio_attachment)
from alexa-voice-service-client.
Related Issues (20)
- get text from AVS HOT 2
- Client could not install HOT 1
- assert response.status in [http.client.NO_CONTENT, http.client.OK] AssertionError HOT 8
- Hello, I got the authentication code but when i use the authentication code to fetch the access token i get 400 Client Error: Bad Request for url: https://api.amazon.com/auth/o2/token. Is there anything missing. HOT 2
- Host name should be input parameter HOT 3
- Client.send_audio_file returning None HOT 2
- Alexa Voice Service returning new response to Sync Device State HOT 1
- Text response from AVS HOT 1
- Not able to receive data on downchannel stream HOT 2
- Can't get payload when request using file - 'Directive' object is not subscriptable HOT 2
- send_audio_file returnes NoneType. HOT 5
- get alert and notification directives HOT 2
- No user authentication HOT 1
- Multi-step requests triggers fallback from the second step for the customized skill HOT 4
- Stream forcefully closed HOT 2
- sdist or tags
- TypeError: 'NoneType' object is not iterable
- AttributeError: 'NoneType' object has no attribute 'request'
- Change the localization/language Feature
- Simple auto file send not returning? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from alexa-voice-service-client.