久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

  • <legend id='ab0Ih'><style id='ab0Ih'><dir id='ab0Ih'><q id='ab0Ih'></q></dir></style></legend>

    <small id='ab0Ih'></small><noframes id='ab0Ih'>

  • <i id='ab0Ih'><tr id='ab0Ih'><dt id='ab0Ih'><q id='ab0Ih'><span id='ab0Ih'><b id='ab0Ih'><form id='ab0Ih'><ins id='ab0Ih'></ins><ul id='ab0Ih'></ul><sub id='ab0Ih'></sub></form><legend id='ab0Ih'></legend><bdo id='ab0Ih'><pre id='ab0Ih'><center id='ab0Ih'></center></pre></bdo></b><th id='ab0Ih'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='ab0Ih'><tfoot id='ab0Ih'></tfoot><dl id='ab0Ih'><fieldset id='ab0Ih'></fieldset></dl></div>

      <bdo id='ab0Ih'></bdo><ul id='ab0Ih'></ul>
    <tfoot id='ab0Ih'></tfoot>

      1. 播放音頻時,最后一部分被切斷.如何解決這個問

        When playing audio, the last part is cut off. How can this be fixed? (discord.py)(播放音頻時,最后一部分被切斷.如何解決這個問題?(discord.py))

          <legend id='NTKFd'><style id='NTKFd'><dir id='NTKFd'><q id='NTKFd'></q></dir></style></legend>

          <small id='NTKFd'></small><noframes id='NTKFd'>

              <tbody id='NTKFd'></tbody>

            <tfoot id='NTKFd'></tfoot>

            • <bdo id='NTKFd'></bdo><ul id='NTKFd'></ul>

                • <i id='NTKFd'><tr id='NTKFd'><dt id='NTKFd'><q id='NTKFd'><span id='NTKFd'><b id='NTKFd'><form id='NTKFd'><ins id='NTKFd'></ins><ul id='NTKFd'></ul><sub id='NTKFd'></sub></form><legend id='NTKFd'></legend><bdo id='NTKFd'><pre id='NTKFd'><center id='NTKFd'></center></pre></bdo></b><th id='NTKFd'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='NTKFd'><tfoot id='NTKFd'></tfoot><dl id='NTKFd'><fieldset id='NTKFd'></fieldset></dl></div>
                  本文介紹了播放音頻時,最后一部分被切斷.如何解決這個問題?(discord.py)的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                  問題描述

                  我正在制作一個機器人,并且我已經弄清楚如何讓它播放來自 youtube 的音頻.音頻是流式傳輸的,因此文件不會下載到我的 PC 上.這是我的代碼:

                  I have a bot I am producing and I have figured out how to make it play audio from youtube. The audio is streamed so the files are not downloaded to my PC. Here is my code:

                  @bot.command(name='play', aliases=['p'], help='Plays a song.')
                  async def play(ctx, url):
                      channel = ctx.message.author.voice.channel
                      if ctx.guild.voice_client is None:
                          await channel.connect()
                      client = ctx.guild.voice_client
                      player = await YTDLSource.from_url(url, stream = True)
                      ctx.voice_client.play(player)
                      await ctx.send('Now Playing: {}'.format(player.title))
                  

                  我正在使用此塊中未顯示的一些代碼,因為它是 basic_voice.py 包的一部分(可在此處找到:https://github.com/Rapptz/discord.py/blob/master/examples/basic_voice.py,我使用的是第 12-52 行).我的問題是音頻在最后被切斷,FFMPEG 窗口在我的電腦上關閉.當我在我的 PC 上測試本地文件時也發生了這種情況.我不確定為什么 FFMPEG 會提前關閉,但如果可能的話,我想修復它.此外,如果它很重要,最后切斷的量取決于正在播放的音頻的長度.播放器工作時沒有延遲,只是莫名其妙地停止了.

                  I am using some code that is not shown in this block because it is part of the basic_voice.py package (found here: https://github.com/Rapptz/discord.py/blob/master/examples/basic_voice.py, I am using lines 12-52). My issue is that the audio is cut off at the end, with the FFMPEG window closing on my PC. This happened when I tested local files on my PC as well. I am not sure why FFMPEG just closes early, but I'd like a fix to it if possible. Also, if it's important, the amount cut off at the end is dependant on the length of the audio being played. The player works with no lag, it just mysteriously stops.

                  推薦答案

                  這是一個已知問題,當您嘗試制作一個不下載它正在播放的歌曲的機器人時.這里解釋:https://support.discord.com/hc/en-us/articles/360035010351--Known-Issue-Music-Bots-Not-Playing-Music-From-Certain-Sources

                  This is a known issue when you try to make a bot which doesn't download the song it's playing. It is explained here : https://support.discord.com/hc/en-us/articles/360035010351--Known-Issue-Music-Bots-Not-Playing-Music-From-Certain-Sources

                  要解決此問題,您可以使用 discord.py 中的 FFmpegPCMAudio 方法并提供特定選項,以便機器人能夠重新連接并繼續播放視頻:

                  To solve the problem, you can use the FFmpegPCMAudio method from discord.py and give specific options so the bot will be able to reconnect and continue to play the video :

                  ydl_opts = {'format': 'bestaudio'}
                  FFMPEG_OPTIONS = {'before_options': '-reconnect 1 -reconnect_streamed 1 -reconnect_delay_max 5', 'options': '-vn'}
                  
                  @bot.command(name='play', aliases=['p'], help='Plays a song.')
                  async def play(ctx, url):
                      channel = ctx.message.author.voice.channel
                      voice = get(self.bot.voice_clients, guild=ctx.guild)
                  
                      if voice and voice.is_connected():
                          await voice.move_to(channel)
                      else:
                          voice = await channel.connect()
                      
                      with youtube_dl.YoutubeDL(ydl_opts) as ydl:
                              source = ydl.extract_info(url, download=False)['formats'][0]['url']
                  
                      voice.play(discord.FFmpegPCMAudio(song['source'], **FFMPEG_OPTIONS))
                      voice.is_playing
                  

                  這篇關于播放音頻時,最后一部分被切斷.如何解決這個問題?(discord.py)的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

                  【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!

                  相關文檔推薦

                  How to make a discord bot that gives roles in Python?(如何制作一個在 Python 中提供角色的不和諧機器人?)
                  Discord bot isn#39;t responding to commands(Discord 機器人沒有響應命令)
                  Can you Get the quot;About mequot; feature on Discord bot#39;s? (Discord.py)(你能得到“關于我嗎?Discord 機器人的功能?(不和諧.py))
                  message.channel.id Discord PY(message.channel.id Discord PY)
                  How do I host my discord.py bot on heroku?(如何在 heroku 上托管我的 discord.py 機器人?)
                  discord.py - Automaticaly Change an Role Color(discord.py - 自動更改角色顏色)

                  <small id='WycX0'></small><noframes id='WycX0'>

                  <tfoot id='WycX0'></tfoot>
                  <i id='WycX0'><tr id='WycX0'><dt id='WycX0'><q id='WycX0'><span id='WycX0'><b id='WycX0'><form id='WycX0'><ins id='WycX0'></ins><ul id='WycX0'></ul><sub id='WycX0'></sub></form><legend id='WycX0'></legend><bdo id='WycX0'><pre id='WycX0'><center id='WycX0'></center></pre></bdo></b><th id='WycX0'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='WycX0'><tfoot id='WycX0'></tfoot><dl id='WycX0'><fieldset id='WycX0'></fieldset></dl></div>
                  • <bdo id='WycX0'></bdo><ul id='WycX0'></ul>
                    • <legend id='WycX0'><style id='WycX0'><dir id='WycX0'><q id='WycX0'></q></dir></style></legend>
                        <tbody id='WycX0'></tbody>

                            主站蜘蛛池模板: 日韩欧美国产不卡 | 黄色一级大片在线免费看产 | 一级特黄a大片 | 精品久久久久久久久久久久久久 | 精品亚洲91| 古典武侠第一页久久777 | 国产999精品久久久 精品三级在线观看 | 国产精品色婷婷久久58 | 成人超碰在线 | 91免费观看国产 | 日韩中文字幕视频 | 91亚洲精品在线 | 欧美黄色免费网站 | 中文字幕福利 | 日韩av免费在线观看 | 日韩精品人成在线播放 | 国产精品视频在线免费观看 | 精品一区二区三区四区 | 亚洲精品福利在线 | 人人干免费 | 亚洲精品小视频在线观看 | 精品国产一区二区国模嫣然 | 亚洲成人日韩 | 午夜精品福利视频 | 99成人精品| 9191成人精品久久 | 一级黄色毛片免费 | 99在线免费视频 | 国产女人与拘做视频免费 | 毛片一级片 | 大吊一区二区 | 欧美日韩国产中文字幕 | 一级欧美| 91精品国产99 | 日本在线视频中文字幕 | 久久久精品一区二区三区 | 99re国产视频 | 日韩av网址在线观看 | 国产精品明星裸体写真集 | 精品1区 | 国产一级一级毛片 |