Added Pre-made opus libraries and basic OS checking
This commit is contained in:
3
.gitignore
vendored
3
.gitignore
vendored
@@ -1,2 +1,5 @@
|
||||
*venv/
|
||||
*__pycache__/
|
||||
*.html
|
||||
*.exe
|
||||
LICENSE
|
||||
15
main.py
15
main.py
@@ -1,11 +1,11 @@
|
||||
import argparse
|
||||
from discord import Intents, Client, Member
|
||||
from sys import platform
|
||||
from discord import Intents, Client, Member, opus
|
||||
from discord.ext import commands
|
||||
from NoiseGatev2 import NoiseGate
|
||||
|
||||
def main(clientId='OTQzNzQyMDQwMjU1MTE1MzA0.Yg3eRA.ZxEbRr55xahjfaUmPY8pmS-RHTY', channelId=367396189529833476, NGThreshold=50, deviceId=1):
|
||||
intents = Intents.default()
|
||||
intents.message_content = True
|
||||
|
||||
client = Client(intents=intents)
|
||||
|
||||
@@ -15,7 +15,16 @@ def main(clientId='OTQzNzQyMDQwMjU1MTE1MzA0.Yg3eRA.ZxEbRr55xahjfaUmPY8pmS-RHTY',
|
||||
|
||||
channelIdToJoin = client.get_channel(channelId)
|
||||
print("Channel", channelIdToJoin)
|
||||
channelConnection = await channelIdToJoin.connect()
|
||||
|
||||
if platform == "linux" or platform == "linux2":
|
||||
# linux
|
||||
opus.load_opus('./opus/libopus_aarcch64.so')
|
||||
|
||||
elif platform == "win32":
|
||||
# Windows...
|
||||
opus.load_opus('./opus/libopus_amd64.dll')
|
||||
|
||||
channelConnection = await channelIdToJoin.connect(timeout=60.0, reconnect=True)
|
||||
print("Joined voice")
|
||||
streamHandler = NoiseGate(
|
||||
_input_device_index=deviceId,
|
||||
|
||||
BIN
opus/libopus_aarcch64.so
Normal file
BIN
opus/libopus_aarcch64.so
Normal file
Binary file not shown.
BIN
opus/libopus_amd64.dll
Normal file
BIN
opus/libopus_amd64.dll
Normal file
Binary file not shown.
BIN
opus/libopus_armv7l.so
Normal file
BIN
opus/libopus_armv7l.so
Normal file
Binary file not shown.
Reference in New Issue
Block a user