質問編集履歴
2
ソースコードの追加
title
CHANGED
File without changes
|
body
CHANGED
@@ -12,4 +12,31 @@
|
|
12
12
|
この書き出し先をファイルではなく変数にする方法はありませんか?
|
13
13
|
os.systemはもう利用すべきではなくなっていて,subprocessを利用したほうがいいのは把握しているのですが,どう書いたらいいのかいまいちよくわからず困っています.
|
14
14
|
|
15
|
-
AquesTalkPiの使い方について:http://blog-yama.a-quest.com/?eid=970157
|
15
|
+
AquesTalkPiの使い方について:http://blog-yama.a-quest.com/?eid=970157
|
16
|
+
|
17
|
+
|
18
|
+
|
19
|
+
以下追記
|
20
|
+
wavファイルをAquesTalkPiで生成,discord内VCで再生
|
21
|
+
```Pyhton
|
22
|
+
async def speakQueueLoop(self,speakQueue):
|
23
|
+
while True:
|
24
|
+
self.playNextQueue.clear()
|
25
|
+
queueTop = await self.speakQueue.get()
|
26
|
+
print(str(list(queueTop.keys())[0]))
|
27
|
+
os.system('./AquesTalkPi ' + str(list(queueTop.keys())[0]) + ' > /mnt/usb1/output.wav')
|
28
|
+
source = discord.FFmpegPCMAudio("/mnt/usb1/output.wav")
|
29
|
+
(list(queueTop.values())[0]).play(source,after=self.toggle_next)
|
30
|
+
await self.playNextQueue.wait()
|
31
|
+
|
32
|
+
def toggle_next(self,error):
|
33
|
+
try:
|
34
|
+
self.bot.loop.call_soon_threadsafe(self.playNextQueue.set)
|
35
|
+
except Exception as e:
|
36
|
+
print(e)
|
37
|
+
```
|
38
|
+
|
39
|
+
queueに追加するコード
|
40
|
+
```Python
|
41
|
+
await self.speakQueue.put_nowait({str(message.content):message.guild.voice_client})
|
42
|
+
```
|
1
タグの追加
title
CHANGED
File without changes
|
body
CHANGED
File without changes
|