Discord.pyでBotを作っており、VCを用いたコマンドを作成しているところ次のエラーが出ました。
メモリを確認しましたが特に問題はありませんでした。
動作環境 Ubuntu18.04LTS
コード
py
1def sound(ctx,num): 2 atk = r"/root/Bots/main/sampleaudio/12.mp3" 3 lose = r"/root/Bots/main/sampleaudio/3.mp3" 4 weapon= r"/root/Bots/main/sampleaudio/10.mp3" 5 geki = r"/root/Bots/main/sampleaudio/17.mp3" 6 ryuusei = r"/root/Bots/main/sampleaudio/8.mp3" 7 ban = r"/root/Bots/main/sampleaudio/7.mp3" 8 9 sounds = (atk, lose, weapon, geki, ryuusei, ban) 10 try: 11 ctx.guild.voice_client.play( 12 FFmpegPCMAudio( 13 executable=r"/usr/bin/ffmpeg", 14 source=sounds[num])) 15 except (discord.errors.ClientException, AttributeError): 16 return
エラー
py
1Traceback (most recent call last): 2 File "/root/Bots/main/taoru.py", line 216, in taoru 3 sound(ctx,0) 4 File "/root/Bots/main/taoru.py", line 34, in sound 5 FFmpegPCMAudio( 6 File "/root/.pyenv/versions/3.9.4/lib/python3.9/site-packages/discord/player.py", line 225, in __init__ 7 super().__init__(source, executable=executable, args=args, **subprocess_kwargs) 8 File "/root/.pyenv/versions/3.9.4/lib/python3.9/site-packages/discord/player.py", line 138, in __init__ 9 self._process = self._spawn_process(args, **kwargs) 10 File "/root/.pyenv/versions/3.9.4/lib/python3.9/site-packages/discord/player.py", line 144, in _spawn_process 11 process = subprocess.Popen(args, creationflags=CREATE_NO_WINDOW, **subprocess_kwargs) 12 File "/root/.pyenv/versions/3.9.4/lib/python3.9/subprocess.py", line 951, in __init__ 13 self._execute_child(args, executable, preexec_fn, close_fds, 14 File "/root/.pyenv/versions/3.9.4/lib/python3.9/subprocess.py", line 1754, in _execute_child 15 self.pid = _posixsubprocess.fork_exec( 16OSError: [Errno 12] Cannot allocate memory
あなたの回答
tips
プレビュー