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

Directives can't play multiple audio file #3

Open
iflamed opened this issue Jan 16, 2018 · 1 comment
Open

Directives can't play multiple audio file #3

iflamed opened this issue Jan 16, 2018 · 1 comment

Comments

@iflamed
Copy link

iflamed commented Jan 16, 2018

Example:

音乐播放指令
AudioPlayer.Play

use \Baidu\Duer\Botsdk\Directive\AudioPlayer\Play;

$directive = new Play('http://www.music', Play::REPLACE_ALL); 
return [
    'directives' => [$directive],
    'outputSpeech' => '正在为你播放歌曲',
];

My code:

use \Baidu\Duer\Botsdk\Directive\AudioPlayer\Play;

$directive = new Play('http://www.music1', Play::ENQUEUE); 
$directive2 = new Play('http://www.music2', Play::ENQUEUE); 
return [
    'directives' => [$directive, $directive2],
    'outputSpeech' => '正在为你播放歌曲',
];

As in my code, Dueros just play the first one music.

@kira3007
Copy link

考虑到最终设备同时只会播放一首音乐。不能一次返回多个播放音乐的指令,如果要让设备连续播放多首歌,应该是监听audioplayer.playbacknearlyfinished事件,在接收到这个事件后,返回一个directive指令,而且是Play::ENQUEUE

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