shin1m / alexaagent

Alexa Voice Service Agent
5 stars 4 forks source link

capture_force & dialog_acquire conflicts #3

Open RogerLaw opened 8 years ago

RogerLaw commented 8 years ago

when capture_force is true, i think it means capture should start immediately and current dialog should stop as well. however now it will wait for active dialog ends.

shin1m commented 8 years ago

Yes, currently, it interrupts Alerts and Content channels but Dialog channel. This is because I was not sure that stopping a dialog is allowed in the API. But now I have found "Note: If a user barges in and interrupts Alexa, SpeechSynthesizer state should be cleared." in SpeechSynthesizer Interface. So, I will improve the behavior.

Thank you.

shin1m commented 8 years ago

Thank you for waiting. I pushed the change to stop SpeechSynthesizer immediately when capture_force become true. Please check it out.

RogerLaw commented 8 years ago

thank you! I just tried. the dialog was interrupted when button pressed, so this works. When I tried 'what's my flash briefing', while it's reading the news, I pressed button, it won't stop immediately, and still playing for 2~4 seconds, then stop and take recognition. And when I was playing iHeartradio station, when I pressed the button, console printed 'PAUSE' and when released, it printed 'RESUME', however music doesn't stop on 'PAUSE' and need to wait for a few seconds. beside, upon recognition finished, the music content and SpeechSynthesizer were playing in the same time.

shin1m commented 8 years ago

Oh I guess there must be buffered data remaining in OpenAL device. I'll try to fix it. Thank you.

shin1m commented 8 years ago

I pushed the change which pauses OpenAL source of AudioPlayer when interrupted. Please check it out.

RogerLaw commented 8 years ago

sorry I just got time to test it. now it woks! still one minor issue: when I interrupt the content and say "next" / or "play"+something else, it will still play 1 second of audio which was paused, then new replaced with new URL.

shin1m commented 8 years ago

Thank you for the report. Currently, the content is resumed when the interruption ends, and continues playing until a new directive comes from AVS. Let me consider whether the content should be cleared or not in this case. Best regards,