Skip to content

Commit

Permalink
fix(LocalPlayer): fix wzpan#27
Browse files Browse the repository at this point in the history
  • Loading branch information
wzpan committed Mar 6, 2019
1 parent cdb7173 commit 625b1d5
Showing 1 changed file with 20 additions and 7 deletions.
27 changes: 20 additions & 7 deletions plugins/LocalPlayer.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,13 +85,26 @@ def handle(self, text, parsed):
self.say('上一首歌')
self.player.prev()
elif self.nlu.hasIntent(parsed, 'CHANGE_VOL'):
word = self.nlu.getSlotWords(parsed, 'CHANGE_VOL', 'user_vd')[0]
if word == '--LOUDER--':
self.say('大声一点')
self.player.turnUp()
else:
self.say('小声一点')
self.player.turnDown()
slots = self.nlu.getSlots(parsed, 'CHANGE_VOL')
for slot in slots:
if slot['name'] == 'user_d':
word = self.nlu.getSlotWords(parsed, 'CHANGE_VOL', 'user_d')[0]
if word == '--HIGHER--':
self.say('调大音量')
self.player.turnUp()
else:
self.say('调小音量')
self.player.turnDown()
return
elif slot['name'] == 'user_vd':
word = self.nlu.getSlotWords(parsed, 'CHANGE_VOL', 'user_vd')[0]
if word == '--LOUDER--':
self.say('大声一点')
self.player.turnUp()
else:
self.say('小声一点')
self.player.turnDown()

elif self.nlu.hasIntent(parsed, 'CLOSE_MUSIC') or self.nlu.hasIntent(parsed, 'PAUSE'):
self.player.stop()
self.clearImmersive() # 去掉沉浸式
Expand Down

0 comments on commit 625b1d5

Please sign in to comment.