Added Audio Notification

This commit is contained in:
Hina 2023-11-23 15:43:02 +08:00
parent a216d4bc9d
commit be3eb4033d

View File

@ -250,6 +250,7 @@
"\n",
"#@markdown **5** - *(optional)* Other options:\n",
"ClearConsole = True # @param {type:\"boolean\"}\n",
"Play_Notification = True # @param {type:\"boolean\"}\n",
"\n",
"# ---------------------------------\n",
"# DO NOT TOUCH ANYTHING DOWN BELOW!\n",
@ -273,6 +274,10 @@
"public_url = ngrokConnection.public_url\n",
"\n",
"from IPython.display import clear_output\n",
"from IPython.display import Audio, display\n",
"def play_notification_sound():\n",
" display(Audio(url='https://raw.githubusercontent.com/hinabl/rmvpe-ai-kaggle/main/custom/audios/notif.mp3', autoplay=True))\n",
"\n",
"\n",
"def wait_for_server():\n",
" while True:\n",
@ -288,6 +293,8 @@
" print(\"Your server is available at:\")\n",
" print(public_url)\n",
" print(\"---------------------------------\")\n",
" if Play_Notification==True:\n",
" play_notification_sound()\n",
"\n",
"threading.Thread(target=wait_for_server, daemon=True).start()\n",
"\n",