heroku deployment, libopus not found

后端 未结 3 1239
孤独总比滥情好
孤独总比滥情好 2021-01-17 01:24

I am trying to host a discord music bot in heroku, but even if it works fine in my local machine, it doesnt seem to be able to find the libopus library deployed.

He

3条回答
  •  借酒劲吻你
    2021-01-17 01:51

    I had similar problem. I don't know if it will work for you, but you can give it a try (when I tried to run it on my computer I got an error, but on Heroku it works perfect).

    I added this to my script:

    import ctypes
    import ctypes.util
     
    print("ctypes - Find opus:")
    a = ctypes.util.find_library('opus')
    print(a)
     
    print("Discord - Load Opus:")
    b = discord.opus.load_opus(a)
    print(b)
     
    print("Discord - Is loaded:")
    c = discord.opus.is_loaded()
    print(c)
    

    Remember to put it before anything linked to audio (the best option is to paste it at the beginning).
    Source

提交回复
热议问题