Esempio n. 1
0
 async def v_music_pack1(self, ctx, tx: str):
     """play music + kawaii_voice_gtts.music_pack1"""
     ytdl_opts = {
         'format':
         'bestaudio/best',
         'outtmpl':
         '%(extractor)s-%(id)s-%(title)s.%(ext)s',
         'restrictfilenames':
         True,
         'noplaylist':
         True,
         'nocheckcertificate':
         True,
         'no_warnings':
         True,
         'default_search':
         'auto',
         'source_address':
         '0.0.0.0',
         'postprocessors': [{
             'key': 'FFmpegExtractAudio',
             'preferredcodec': 'mp3',
         }]
     }
     filename = await Youtube.ydl_proc(self, ctx, tx, ytdl_opts)
     imouto = kawaii_voice_gtts.kawaii_voice(filename)
     imouto = imouto.music_pack1()
     imouto.audio.export(filename, 'mp3')
     await VoiceChat.voice_send(self, ctx, filename)
Esempio n. 2
0
    async def make_tts(
        self, ctx, text, lg, k_option
    ):  # text=text, lg=language, k_option=kawaii_voice_gtts(0=false, 1=true)
        voice_client = ctx.message.guild.voice_client
        text = ' '.join(text)
        pool = string.ascii_letters + string.digits
        randm = ''.join(random.choice(pool) for i in range(16))
        filename = str(randm) + ".mp3"
        gTTS(str(text), lang=lg).save(filename)

        if k_option == 1:
            imouto = kawaii_voice_gtts.kawaii_voice(filename)
            imouto = imouto.pitch(0.4)
            imouto.audio.export(filename, 'mp3')

        if not voice_client:  # join voice channel
            await ctx.author.voice.channel.connect()
        await VoiceChat.voice_send(self, ctx, filename)
Esempio n. 3
0
# Sample of converting music to nightcore

import sys
sys.path.append('../')
import kawaii_voice_gtts
from playsound import playsound

file_name = 'music.mp3'

# ----- music synthesis
imouto = kawaii_voice_gtts.kawaii_voice(file_name)
# imouto = imouto.bass_boost(0)
# imouto = imouto.normalize()
imouto = imouto.music_pack1()
imouto.audio.export('music_.mp3', 'mp3')

# playsound('music_.mp3')