"This is an attempt to run [Realtime Voice Changer](https://github.com/w-okada/voice-changer) on Google Colab, still not perfect but is totally usable, you can use the following settings for better results:\n",
"\n",
"If you're using a index: `f0: RMVPE_ONNX | Chunk: 112 or higher | Extra: 8192`\\\n",
"If you're not using a index: `f0: RMVPE_ONNX | Chunk: 96 or higher | Extra: 16384`\\\n",
"**Don't forget to select your Colab GPU in the GPU field (<b>Tesla T4</b>, for free users)*\n",
"> Seems that PTH models performance better than ONNX for now, you can still try ONNX models and see if it satisfies you\n",
"\n",
"\n",
"*You can always [click here](https://github.com/YunaOneeChan/Voice-Changer-Settings) to check if these settings are up-to-date*\n",
"<br><br>\n",
"\n",
"---\n",
"\n",
"###Always use Colab GPU (**VERY VERY VERY IMPORTANT!**)\n",
"You need to use a Colab GPU so the Voice Changer can work faster and better\\\n",
"Use the menu above and click on **Runtime** » **Change runtime** » **Hardware acceleration** to select a GPU (**T4 is the free one**)\n",
"\n",
"---\n",
"\n",
"<br>\n",
"\n",
"# **Credits and Support**\n",
"Realtime Voice Changer by [w-okada](https://github.com/w-okada)\\\n",
"Colab files updated by [rafacasari](https://github.com/Rafacasari)\\\n",
"Recommended settings by [YunaOneeChan](https://github.com/YunaOneeChan)\n",
"# @title **[Optional]** Connect to Google Drive\n",
"# @markdown Using Google Drive can improve load times a bit and your models will be stored, so you don't need to re-upload every time that you use.\n",
"# @title **[1]** Clone repository and install dependencies\n",
"# @markdown This first step will download the latest version of Voice Changer and install the dependencies. **It will take around 2 minutes to complete.**\n",
"# @markdown **4** - Still need further tests, but maybe region can help a bit on latency?\\\n",
"# @markdown `Default Region: us - United States (Ohio)`\n",
"Region = \"us - United States (Ohio)\" # @param [\"ap - Asia/Pacific (Singapore)\", \"au - Australia (Sydney)\",\"eu - Europe (Frankfurt)\", \"in - India (Mumbai)\",\"jp - Japan (Tokyo)\",\"sa - South America (Sao Paulo)\", \"us - United States (Ohio)\"]\n",
"\n",
"MyConfig = conf.PyngrokConfig()\n",
"\n",
"MyConfig.auth_token = Token\n",
"MyConfig.region = Region[0:2]\n",
"\n",
"conf.get_default().authtoken = Token\n",
"conf.get_default().region = Region[0:2]\n",
"\n",
"conf.set_default(MyConfig);\n",
"\n",
"# @markdown ---\n",
"# @markdown If you want to automatically clear the output when the server loads, check this option.\n",
" result = sock.connect_ex(('127.0.0.1', port))\n",
" if result == 0:\n",
" break\n",
" sock.close()\n",
" clear_output()\n",
" print(\"Use the following endpoint to connect to localtunnel:\", urllib.request.urlopen('https://ipv4.icanhazip.com').read().decode('utf8').strip(\"\\n\"))\n",
" p = subprocess.Popen([\"lt\", \"--port\", \"{}\".format(port)], stdout=subprocess.PIPE)\n",
"# @title **[BROKEN]** Start Server using Colab Tunnels (trying to fix this TwT)\n",
"# @markdown **Issue:** Everything starts correctly, but when you try to use the client, you'll see in your browser console a bunch of errors **(Error 500 - Not Allowed.)**\n",
"\n",
"import portpicker, subprocess, threading, time, socket, urllib.request\n",