Skip to content

Commit

Permalink
fix: 修复修改配置后self.player变为None的bug
Browse files Browse the repository at this point in the history
  • Loading branch information
wzpan committed Mar 26, 2023
1 parent 77dcefe commit c00f454
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion robot/Conversation.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ def reInit(self):
self.ai = AI.get_robot_by_slug(config.get("robot", "tuling"))
self.tts = TTS.get_engine_by_slug(config.get("tts_engine", "baidu-tts"))
self.nlu = NLU.get_engine_by_slug(config.get("nlu_engine", "unit"))
self.player = None
self.player = Player.SoxPlayer()
self.brain = Brain(self)
self.brain.printPlugins()
except Exception as e:
Expand Down

2 comments on commit c00f454

@weibinke
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

提个建议:Conversation对player初始化现在重复了,reInit()这里创建了player,而init里也有创建,正常会导致启动一定会有两个player,其中第一个是空跑的,创建了线程但没用,按现在的逻辑看,init的初始化应该可以去掉?非常建议这里改下哈。

@wzpan
Copy link
Owner Author

@wzpan wzpan commented on c00f454 Nov 23, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

提个建议:Conversation对player初始化现在重复了,reInit()这里创建了player,而init里也有创建,正常会导致启动一定会有两个player,其中第一个是空跑的,创建了线程但没用,按现在的逻辑看,init的初始化应该可以去掉?非常建议这里改下哈。

收到,我看看。

Please sign in to comment.