Skip to content

Instantly share code, notes, and snippets.

@Hokila
Created July 8, 2025 07:59
Show Gist options
  • Select an option

  • Save Hokila/c817fe1a30017983193f915380e73844 to your computer and use it in GitHub Desktop.

Select an option

Save Hokila/c817fe1a30017983193f915380e73844 to your computer and use it in GitHub Desktop.
faster-whisper to txt or srt
Display the source blob
Display the rendered blob
Raw
{
"nbformat": 4,
"nbformat_minor": 0,
"metadata": {
"colab": {
"provenance": [],
"gpuType": "T4",
"include_colab_link": true
},
"kernelspec": {
"name": "python3",
"display_name": "Python 3"
},
"language_info": {
"name": "python"
},
"accelerator": "GPU",
"widgets": {
"application/vnd.jupyter.widget-state+json": {
"0b86f4d3c48b48be839eb4a95b986d83": {
"model_module": "@jupyter-widgets/controls",
"model_name": "VBoxModel",
"model_module_version": "1.5.0",
"state": {
"_dom_classes": [],
"_model_module": "@jupyter-widgets/controls",
"_model_module_version": "1.5.0",
"_model_name": "VBoxModel",
"_view_count": null,
"_view_module": "@jupyter-widgets/controls",
"_view_module_version": "1.5.0",
"_view_name": "VBoxView",
"box_style": "",
"children": [
"IPY_MODEL_64d3d7f7c65d496c99d0dca212bba72a",
"IPY_MODEL_6401cb1ee1dd4073879f4b3482f4daa7",
"IPY_MODEL_097a498a7a63462d82afe1cb1eb7382f"
],
"layout": "IPY_MODEL_f1996e6e68164de589b30bf358c041bf"
}
},
"64d3d7f7c65d496c99d0dca212bba72a": {
"model_module": "@jupyter-widgets/controls",
"model_name": "VBoxModel",
"model_module_version": "1.5.0",
"state": {
"_dom_classes": [],
"_model_module": "@jupyter-widgets/controls",
"_model_module_version": "1.5.0",
"_model_name": "VBoxModel",
"_view_count": null,
"_view_module": "@jupyter-widgets/controls",
"_view_module_version": "1.5.0",
"_view_name": "VBoxView",
"box_style": "",
"children": [
"IPY_MODEL_41708c8224ec4b1892232c4f5c6c7b73",
"IPY_MODEL_66c8d2a4584b4d19b6a399f6887d0726",
"IPY_MODEL_eb18b7d7975342f3a00ad812320e7118"
],
"layout": "IPY_MODEL_de237980eef04204b750953030ac861e"
}
},
"6401cb1ee1dd4073879f4b3482f4daa7": {
"model_module": "@jupyter-widgets/controls",
"model_name": "HBoxModel",
"model_module_version": "1.5.0",
"state": {
"_dom_classes": [],
"_model_module": "@jupyter-widgets/controls",
"_model_module_version": "1.5.0",
"_model_name": "HBoxModel",
"_view_count": null,
"_view_module": "@jupyter-widgets/controls",
"_view_module_version": "1.5.0",
"_view_name": "HBoxView",
"box_style": "",
"children": [
"IPY_MODEL_37cad5e13fbf4ea1b65b87606a6a2f08",
"IPY_MODEL_6ef44ee6a981458f8e7b11dc0fb181d9",
"IPY_MODEL_a45a76de0e86459b9138bc851e995218"
],
"layout": "IPY_MODEL_3edfb40ed33d417c8ae7f54891d63ffe"
}
},
"097a498a7a63462d82afe1cb1eb7382f": {
"model_module": "@jupyter-widgets/output",
"model_name": "OutputModel",
"model_module_version": "1.0.0",
"state": {
"_dom_classes": [],
"_model_module": "@jupyter-widgets/output",
"_model_module_version": "1.0.0",
"_model_name": "OutputModel",
"_view_count": null,
"_view_module": "@jupyter-widgets/output",
"_view_module_version": "1.0.0",
"_view_name": "OutputView",
"layout": "IPY_MODEL_0cc298d1db0645078d698b534a692b72",
"msg_id": "",
"outputs": [
{
"output_type": "stream",
"name": "stdout",
"text": [
"🔍 共找到 33 個音訊檔,開始處理...\n",
"\n",
"[1/33] 🎬 開始處理:16\n",
"[2/33] 🎬 開始處理:21\n",
"[3/33] 🎬 開始處理:10\n",
"[4/33] 🎬 開始處理:00\n"
]
},
{
"output_type": "stream",
"name": "stdout",
"text": [
"[12/42] 🎬 開始處理:10\n"
]
},
{
"output_type": "stream",
"name": "stdout",
"text": [
"[2/33] ✅ 完成:21\n",
"[5/33] 🎬 開始處理:01\n"
]
},
{
"output_type": "stream",
"name": "stdout",
"text": [
"[3/33] ✅ 完成:10\n",
"[6/33] 🎬 開始處理:04\n"
]
},
{
"output_type": "stream",
"name": "stdout",
"text": [
"[13/42] 🎬 開始處理:00\n"
]
},
{
"output_type": "stream",
"name": "stdout",
"text": [
"[14/42] 🎬 開始處理:01\n"
]
},
{
"output_type": "stream",
"name": "stdout",
"text": [
"[5/33] ✅ 完成:01\n",
"[7/33] 🎬 開始處理:03\n"
]
},
{
"output_type": "stream",
"name": "stdout",
"text": [
"[4/33] ✅ 完成:00\n",
"[8/33] 🎬 開始處理:37\n"
]
},
{
"output_type": "stream",
"name": "stdout",
"text": [
"[15/42] 🎬 開始處理:04\n"
]
},
{
"output_type": "stream",
"name": "stdout",
"text": [
"[16/42] 🎬 開始處理:03\n"
]
},
{
"output_type": "stream",
"name": "stdout",
"text": [
"[1/33] ✅ 完成:16\n",
"[9/33] 🎬 開始處理:25\n"
]
},
{
"output_type": "stream",
"name": "stdout",
"text": [
"[8/33] ✅ 完成:37\n",
"[10/33] 🎬 開始處理:20\n"
]
},
{
"output_type": "stream",
"name": "stdout",
"text": [
"[7/33] ✅ 完成:03\n",
"[11/33] 🎬 開始處理:19\n"
]
},
{
"output_type": "stream",
"name": "stdout",
"text": [
"[9/33] ✅ 完成:25\n",
"[12/33] 🎬 開始處理:18\n"
]
},
{
"output_type": "stream",
"name": "stdout",
"text": [
"[13/33] 🎬 開始處理:17[6/33] ✅ 完成:04\n",
"\n"
]
},
{
"output_type": "stream",
"name": "stdout",
"text": [
"[19/42] 🎬 開始處理:20\n"
]
},
{
"output_type": "stream",
"name": "stdout",
"text": [
"[20/42] 🎬 開始處理:19\n"
]
},
{
"output_type": "stream",
"name": "stdout",
"text": [
"[10/33] ✅ 完成:20\n",
"[14/33] 🎬 開始處理:14\n"
]
},
{
"output_type": "stream",
"name": "stdout",
"text": [
"[14/33] ✅ 完成:14\n",
"[15/33] 🎬 開始處理:13\n"
]
},
{
"output_type": "stream",
"name": "stdout",
"text": [
"[21/42] 🎬 開始處理:18\n"
]
},
{
"output_type": "stream",
"name": "stdout",
"text": [
"[13/33] ✅ 完成:17\n",
"[16/33] 🎬 開始處理:12\n"
]
},
{
"output_type": "stream",
"name": "stdout",
"text": [
"[11/33] ✅ 完成:19\n",
"[17/33] 🎬 開始處理:09\n"
]
},
{
"output_type": "stream",
"name": "stdout",
"text": [
"[12/33] ✅ 完成:18\n",
"[18/33] 🎬 開始處理:08\n"
]
},
{
"output_type": "stream",
"name": "stdout",
"text": [
"[24/42] 🎬 開始處理:13\n"
]
},
{
"output_type": "stream",
"name": "stdout",
"text": [
"[17/33] ✅ 完成:09\n",
"[19/33] 🎬 開始處理:07\n"
]
},
{
"output_type": "stream",
"name": "stdout",
"text": [
"[16/33] ✅ 完成:12\n",
"[20/33] 🎬 開始處理:06\n"
]
},
{
"output_type": "stream",
"name": "stdout",
"text": [
"[27/42] 🎬 開始處理:08\n"
]
},
{
"output_type": "stream",
"name": "stdout",
"text": [
"[15/33] ✅ 完成:13\n",
"[21/33] 🎬 開始處理:05\n"
]
},
{
"output_type": "stream",
"name": "stdout",
"text": [
"[28/42] 🎬 開始處理:07\n"
]
},
{
"output_type": "stream",
"name": "stdout",
"text": [
"[18/33] ✅ 完成:08\n",
"[22/33] 🎬 開始處理:35\n"
]
},
{
"output_type": "stream",
"name": "stdout",
"text": [
"[20/33] ✅ 完成:06\n",
"[23/33] 🎬 開始處理:34\n"
]
},
{
"output_type": "stream",
"name": "stdout",
"text": [
"[19/33] ✅ 完成:07\n",
"[24/33] 🎬 開始處理:33\n"
]
},
{
"output_type": "stream",
"name": "stdout",
"text": [
"[30/42] 🎬 開始處理:05\n"
]
},
{
"output_type": "stream",
"name": "stdout",
"text": [
"[21/33] ✅ 完成:05\n",
"[25/33] 🎬 開始處理:29\n"
]
},
{
"output_type": "stream",
"name": "stdout",
"text": [
"[22/33] ✅ 完成:35\n",
"[26/33] 🎬 開始處理:28\n"
]
},
{
"output_type": "stream",
"name": "stdout",
"text": [
"[24/33] ✅ 完成:33\n",
"[27/33] 🎬 開始處理:27\n"
]
},
{
"output_type": "stream",
"name": "stdout",
"text": [
"[32/42] 🎬 開始處理:34\n"
]
},
{
"output_type": "stream",
"name": "stdout",
"text": [
"[23/33] ✅ 完成:34\n",
"[28/33] 🎬 開始處理:26\n"
]
},
{
"output_type": "stream",
"name": "stdout",
"text": [
"[25/33] ✅ 完成:29\n",
"[29/33] 🎬 開始處理:41\n"
]
},
{
"output_type": "stream",
"name": "stdout",
"text": [
"[27/33] ✅ 完成:27\n",
"[30/33] 🎬 開始處理:40\n"
]
},
{
"output_type": "stream",
"name": "stdout",
"text": [
"[26/33] ✅ 完成:28\n",
"[31/33] 🎬 開始處理:39\n"
]
},
{
"output_type": "stream",
"name": "stdout",
"text": [
"[28/33] ✅ 完成:26\n",
"[32/33] 🎬 開始處理:38\n"
]
},
{
"output_type": "stream",
"name": "stdout",
"text": [
"[38/42] 🎬 開始處理:41\n"
]
},
{
"output_type": "stream",
"name": "stdout",
"text": [
"[39/42] 🎬 開始處理:40\n"
]
},
{
"output_type": "stream",
"name": "stdout",
"text": [
"[29/33] ✅ 完成:41\n",
"[33/33] 🎬 開始處理:36\n"
]
},
{
"output_type": "stream",
"name": "stdout",
"text": [
"[33/33] ✅ 完成:36\n"
]
},
{
"output_type": "stream",
"name": "stdout",
"text": [
"[31/33] ✅ 完成:39\n"
]
},
{
"output_type": "stream",
"name": "stdout",
"text": [
"[30/33] ✅ 完成:40\n"
]
},
{
"output_type": "stream",
"name": "stdout",
"text": [
"[41/42] 🎬 開始處理:38\n"
]
},
{
"output_type": "stream",
"name": "stdout",
"text": [
"[32/33] ✅ 完成:38\n",
"\n",
"✅ 所有字幕已儲存至: /content/drive/MyDrive/Subtitles\n"
]
}
]
}
},
"f1996e6e68164de589b30bf358c041bf": {
"model_module": "@jupyter-widgets/base",
"model_name": "LayoutModel",
"model_module_version": "1.2.0",
"state": {
"_model_module": "@jupyter-widgets/base",
"_model_module_version": "1.2.0",
"_model_name": "LayoutModel",
"_view_count": null,
"_view_module": "@jupyter-widgets/base",
"_view_module_version": "1.2.0",
"_view_name": "LayoutView",
"align_content": null,
"align_items": null,
"align_self": null,
"border": null,
"bottom": null,
"display": null,
"flex": null,
"flex_flow": null,
"grid_area": null,
"grid_auto_columns": null,
"grid_auto_flow": null,
"grid_auto_rows": null,
"grid_column": null,
"grid_gap": null,
"grid_row": null,
"grid_template_areas": null,
"grid_template_columns": null,
"grid_template_rows": null,
"height": null,
"justify_content": null,
"justify_items": null,
"left": null,
"margin": null,
"max_height": null,
"max_width": null,
"min_height": null,
"min_width": null,
"object_fit": null,
"object_position": null,
"order": null,
"overflow": null,
"overflow_x": null,
"overflow_y": null,
"padding": null,
"right": null,
"top": null,
"visibility": null,
"width": null
}
},
"41708c8224ec4b1892232c4f5c6c7b73": {
"model_module": "@jupyter-widgets/controls",
"model_name": "HTMLModel",
"model_module_version": "1.5.0",
"state": {
"_dom_classes": [],
"_model_module": "@jupyter-widgets/controls",
"_model_module_version": "1.5.0",
"_model_name": "HTMLModel",
"_view_count": null,
"_view_module": "@jupyter-widgets/controls",
"_view_module_version": "1.5.0",
"_view_name": "HTMLView",
"description": "",
"description_tooltip": null,
"layout": "IPY_MODEL_974752bfd67b44b8bcc248fa43f701d3",
"placeholder": "​",
"style": "IPY_MODEL_f2938bd8f4af4b31a10dfb9c75fb4935",
"value": "<b>選擇音訊資料夾</b>"
}
},
"66c8d2a4584b4d19b6a399f6887d0726": {
"model_module": "@jupyter-widgets/controls",
"model_name": "GridBoxModel",
"model_module_version": "1.5.0",
"state": {
"_dom_classes": [],
"_model_module": "@jupyter-widgets/controls",
"_model_module_version": "1.5.0",
"_model_name": "GridBoxModel",
"_view_count": null,
"_view_module": "@jupyter-widgets/controls",
"_view_module_version": "1.5.0",
"_view_name": "GridBoxView",
"box_style": "",
"children": [
"IPY_MODEL_6eb589bdb4a141e894046a0b7fbfc4e4",
"IPY_MODEL_5b13c3d01e5147279043d61c432adbbd",
"IPY_MODEL_946916c7fd4c425c97858853ed8ff5a9"
],
"layout": "IPY_MODEL_22ba55e216844bb28aaebfc997127d9e"
}
},
"eb18b7d7975342f3a00ad812320e7118": {
"model_module": "@jupyter-widgets/controls",
"model_name": "HBoxModel",
"model_module_version": "1.5.0",
"state": {
"_dom_classes": [],
"_model_module": "@jupyter-widgets/controls",
"_model_module_version": "1.5.0",
"_model_name": "HBoxModel",
"_view_count": null,
"_view_module": "@jupyter-widgets/controls",
"_view_module_version": "1.5.0",
"_view_name": "HBoxView",
"box_style": "",
"children": [
"IPY_MODEL_a6d881538e5743d38a60f0bdcc81b068",
"IPY_MODEL_e5b06037b89441329b44732b48571873",
"IPY_MODEL_e6689bd88cc8403d84003f14cd8974ab"
],
"layout": "IPY_MODEL_461bf72e9e264f20bc1446c316b92e5d"
}
},
"de237980eef04204b750953030ac861e": {
"model_module": "@jupyter-widgets/base",
"model_name": "LayoutModel",
"model_module_version": "1.2.0",
"state": {
"_model_module": "@jupyter-widgets/base",
"_model_module_version": "1.2.0",
"_model_name": "LayoutModel",
"_view_count": null,
"_view_module": "@jupyter-widgets/base",
"_view_module_version": "1.2.0",
"_view_name": "LayoutView",
"align_content": null,
"align_items": null,
"align_self": null,
"border": null,
"bottom": null,
"display": null,
"flex": null,
"flex_flow": null,
"grid_area": null,
"grid_auto_columns": null,
"grid_auto_flow": null,
"grid_auto_rows": null,
"grid_column": null,
"grid_gap": null,
"grid_row": null,
"grid_template_areas": null,
"grid_template_columns": null,
"grid_template_rows": null,
"height": null,
"justify_content": null,
"justify_items": null,
"left": null,
"margin": null,
"max_height": null,
"max_width": null,
"min_height": null,
"min_width": null,
"object_fit": null,
"object_position": null,
"order": null,
"overflow": null,
"overflow_x": null,
"overflow_y": null,
"padding": null,
"right": null,
"top": null,
"visibility": null,
"width": "500px"
}
},
"37cad5e13fbf4ea1b65b87606a6a2f08": {
"model_module": "@jupyter-widgets/controls",
"model_name": "DropdownModel",
"model_module_version": "1.5.0",
"state": {
"_dom_classes": [],
"_model_module": "@jupyter-widgets/controls",
"_model_module_version": "1.5.0",
"_model_name": "DropdownModel",
"_options_labels": [
"中文",
"English",
"日本語"
],
"_view_count": null,
"_view_module": "@jupyter-widgets/controls",
"_view_module_version": "1.5.0",
"_view_name": "DropdownView",
"description": "語言:",
"description_tooltip": null,
"disabled": false,
"index": 2,
"layout": "IPY_MODEL_11732868f38c4a3e8679a9431271fccb",
"style": "IPY_MODEL_38af505ed6584720a1cfed391b85f243"
}
},
"6ef44ee6a981458f8e7b11dc0fb181d9": {
"model_module": "@jupyter-widgets/controls",
"model_name": "DropdownModel",
"model_module_version": "1.5.0",
"state": {
"_dom_classes": [],
"_model_module": "@jupyter-widgets/controls",
"_model_module_version": "1.5.0",
"_model_name": "DropdownModel",
"_options_labels": [
"srt 字幕檔",
"line by line"
],
"_view_count": null,
"_view_module": "@jupyter-widgets/controls",
"_view_module_version": "1.5.0",
"_view_name": "DropdownView",
"description": "功能:",
"description_tooltip": null,
"disabled": false,
"index": 1,
"layout": "IPY_MODEL_d6bb2d8d366c47bfbb6be9c6492f6685",
"style": "IPY_MODEL_d91ef771417c446487f9ea53ba124564"
}
},
"a45a76de0e86459b9138bc851e995218": {
"model_module": "@jupyter-widgets/controls",
"model_name": "ButtonModel",
"model_module_version": "1.5.0",
"state": {
"_dom_classes": [],
"_model_module": "@jupyter-widgets/controls",
"_model_module_version": "1.5.0",
"_model_name": "ButtonModel",
"_view_count": null,
"_view_module": "@jupyter-widgets/controls",
"_view_module_version": "1.5.0",
"_view_name": "ButtonView",
"button_style": "success",
"description": "批次產生字幕",
"disabled": false,
"icon": "check",
"layout": "IPY_MODEL_9311ffd4ace84173a83842dad4c94f58",
"style": "IPY_MODEL_ef06999aabe84d94be23b6ada3369622",
"tooltip": ""
}
},
"3edfb40ed33d417c8ae7f54891d63ffe": {
"model_module": "@jupyter-widgets/base",
"model_name": "LayoutModel",
"model_module_version": "1.2.0",
"state": {
"_model_module": "@jupyter-widgets/base",
"_model_module_version": "1.2.0",
"_model_name": "LayoutModel",
"_view_count": null,
"_view_module": "@jupyter-widgets/base",
"_view_module_version": "1.2.0",
"_view_name": "LayoutView",
"align_content": null,
"align_items": null,
"align_self": null,
"border": null,
"bottom": null,
"display": null,
"flex": null,
"flex_flow": null,
"grid_area": null,
"grid_auto_columns": null,
"grid_auto_flow": null,
"grid_auto_rows": null,
"grid_column": null,
"grid_gap": null,
"grid_row": null,
"grid_template_areas": null,
"grid_template_columns": null,
"grid_template_rows": null,
"height": null,
"justify_content": null,
"justify_items": null,
"left": null,
"margin": null,
"max_height": null,
"max_width": null,
"min_height": null,
"min_width": null,
"object_fit": null,
"object_position": null,
"order": null,
"overflow": null,
"overflow_x": null,
"overflow_y": null,
"padding": null,
"right": null,
"top": null,
"visibility": null,
"width": null
}
},
"974752bfd67b44b8bcc248fa43f701d3": {
"model_module": "@jupyter-widgets/base",
"model_name": "LayoutModel",
"model_module_version": "1.2.0",
"state": {
"_model_module": "@jupyter-widgets/base",
"_model_module_version": "1.2.0",
"_model_name": "LayoutModel",
"_view_count": null,
"_view_module": "@jupyter-widgets/base",
"_view_module_version": "1.2.0",
"_view_name": "LayoutView",
"align_content": null,
"align_items": null,
"align_self": null,
"border": null,
"bottom": null,
"display": null,
"flex": null,
"flex_flow": null,
"grid_area": null,
"grid_auto_columns": null,
"grid_auto_flow": null,
"grid_auto_rows": null,
"grid_column": null,
"grid_gap": null,
"grid_row": null,
"grid_template_areas": null,
"grid_template_columns": null,
"grid_template_rows": null,
"height": null,
"justify_content": null,
"justify_items": null,
"left": null,
"margin": null,
"max_height": null,
"max_width": null,
"min_height": null,
"min_width": null,
"object_fit": null,
"object_position": null,
"order": null,
"overflow": null,
"overflow_x": null,
"overflow_y": null,
"padding": null,
"right": null,
"top": null,
"visibility": null,
"width": null
}
},
"f2938bd8f4af4b31a10dfb9c75fb4935": {
"model_module": "@jupyter-widgets/controls",
"model_name": "DescriptionStyleModel",
"model_module_version": "1.5.0",
"state": {
"_model_module": "@jupyter-widgets/controls",
"_model_module_version": "1.5.0",
"_model_name": "DescriptionStyleModel",
"_view_count": null,
"_view_module": "@jupyter-widgets/base",
"_view_module_version": "1.2.0",
"_view_name": "StyleView",
"description_width": ""
}
},
"6eb589bdb4a141e894046a0b7fbfc4e4": {
"model_module": "@jupyter-widgets/controls",
"model_name": "DropdownModel",
"model_module_version": "1.5.0",
"state": {
"_dom_classes": [],
"_model_module": "@jupyter-widgets/controls",
"_model_module_version": "1.5.0",
"_model_name": "DropdownModel",
"_options_labels": [
"/content/drive/MyDrive/mp3",
"/content/drive/MyDrive",
"/content/drive",
"/content",
"/"
],
"_view_count": null,
"_view_module": "@jupyter-widgets/controls",
"_view_module_version": "1.5.0",
"_view_name": "DropdownView",
"description": "",
"description_tooltip": null,
"disabled": false,
"index": 0,
"layout": "IPY_MODEL_effd4367cf1742d7960488a538e6fe3b",
"style": "IPY_MODEL_0462c4711c214cafbd995cd97daf0fc7"
}
},
"5b13c3d01e5147279043d61c432adbbd": {
"model_module": "@jupyter-widgets/controls",
"model_name": "TextModel",
"model_module_version": "1.5.0",
"state": {
"_dom_classes": [],
"_model_module": "@jupyter-widgets/controls",
"_model_module_version": "1.5.0",
"_model_name": "TextModel",
"_view_count": null,
"_view_module": "@jupyter-widgets/controls",
"_view_module_version": "1.5.0",
"_view_name": "TextView",
"continuous_update": true,
"description": "",
"description_tooltip": null,
"disabled": true,
"layout": "IPY_MODEL_a29585effd9e4c39a8b16915b60b7bcd",
"placeholder": "output filename",
"style": "IPY_MODEL_3da425b4936745f292657e8e96c12b88",
"value": ""
}
},
"946916c7fd4c425c97858853ed8ff5a9": {
"model_module": "@jupyter-widgets/controls",
"model_name": "SelectModel",
"model_module_version": "1.5.0",
"state": {
"_dom_classes": [],
"_model_module": "@jupyter-widgets/controls",
"_model_module_version": "1.5.0",
"_model_name": "SelectModel",
"_options_labels": [
"📁 .."
],
"_view_count": null,
"_view_module": "@jupyter-widgets/controls",
"_view_module_version": "1.5.0",
"_view_name": "SelectView",
"description": "",
"description_tooltip": null,
"disabled": false,
"index": null,
"layout": "IPY_MODEL_92c51dd4113e4bc3ab54a6158c46a346",
"rows": 8,
"style": "IPY_MODEL_9dcd0f7264434427bdbc58377520ef63"
}
},
"22ba55e216844bb28aaebfc997127d9e": {
"model_module": "@jupyter-widgets/base",
"model_name": "LayoutModel",
"model_module_version": "1.2.0",
"state": {
"_model_module": "@jupyter-widgets/base",
"_model_module_version": "1.2.0",
"_model_name": "LayoutModel",
"_view_count": null,
"_view_module": "@jupyter-widgets/base",
"_view_module_version": "1.2.0",
"_view_name": "LayoutView",
"align_content": null,
"align_items": null,
"align_self": null,
"border": null,
"bottom": null,
"display": "none",
"flex": null,
"flex_flow": null,
"grid_area": null,
"grid_auto_columns": null,
"grid_auto_flow": null,
"grid_auto_rows": null,
"grid_column": null,
"grid_gap": "0px 0px",
"grid_row": null,
"grid_template_areas": "\n 'pathlist pathlist'\n 'dircontent dircontent'\n ",
"grid_template_columns": "60% 40%",
"grid_template_rows": "auto auto",
"height": null,
"justify_content": null,
"justify_items": null,
"left": null,
"margin": null,
"max_height": null,
"max_width": null,
"min_height": null,
"min_width": null,
"object_fit": null,
"object_position": null,
"order": null,
"overflow": null,
"overflow_x": null,
"overflow_y": null,
"padding": null,
"right": null,
"top": null,
"visibility": null,
"width": "auto"
}
},
"a6d881538e5743d38a60f0bdcc81b068": {
"model_module": "@jupyter-widgets/controls",
"model_name": "ButtonModel",
"model_module_version": "1.5.0",
"state": {
"_dom_classes": [],
"_model_module": "@jupyter-widgets/controls",
"_model_module_version": "1.5.0",
"_model_name": "ButtonModel",
"_view_count": null,
"_view_module": "@jupyter-widgets/controls",
"_view_module_version": "1.5.0",
"_view_name": "ButtonView",
"button_style": "",
"description": "Change",
"disabled": false,
"icon": "",
"layout": "IPY_MODEL_63ae5e09c33442b9b4da7bcf68c984b4",
"style": "IPY_MODEL_76bb031bf7314e40b055772d8da19c48",
"tooltip": ""
}
},
"e5b06037b89441329b44732b48571873": {
"model_module": "@jupyter-widgets/controls",
"model_name": "ButtonModel",
"model_module_version": "1.5.0",
"state": {
"_dom_classes": [],
"_model_module": "@jupyter-widgets/controls",
"_model_module_version": "1.5.0",
"_model_name": "ButtonModel",
"_view_count": null,
"_view_module": "@jupyter-widgets/controls",
"_view_module_version": "1.5.0",
"_view_name": "ButtonView",
"button_style": "",
"description": "Cancel",
"disabled": false,
"icon": "",
"layout": "IPY_MODEL_f3b32187c9614e64b78389596bbbd418",
"style": "IPY_MODEL_b87c98adaa3d472bbf87baf0f24f7388",
"tooltip": ""
}
},
"e6689bd88cc8403d84003f14cd8974ab": {
"model_module": "@jupyter-widgets/controls",
"model_name": "BoxModel",
"model_module_version": "1.5.0",
"state": {
"_dom_classes": [],
"_model_module": "@jupyter-widgets/controls",
"_model_module_version": "1.5.0",
"_model_name": "BoxModel",
"_view_count": null,
"_view_module": "@jupyter-widgets/controls",
"_view_module_version": "1.5.0",
"_view_name": "BoxView",
"box_style": "",
"children": [
"IPY_MODEL_4ba40e1613a94e268641303368d426b6"
],
"layout": "IPY_MODEL_3c24ac8dd6be41bf8c96a51002c6764d"
}
},
"461bf72e9e264f20bc1446c316b92e5d": {
"model_module": "@jupyter-widgets/base",
"model_name": "LayoutModel",
"model_module_version": "1.2.0",
"state": {
"_model_module": "@jupyter-widgets/base",
"_model_module_version": "1.2.0",
"_model_name": "LayoutModel",
"_view_count": null,
"_view_module": "@jupyter-widgets/base",
"_view_module_version": "1.2.0",
"_view_name": "LayoutView",
"align_content": null,
"align_items": null,
"align_self": null,
"border": null,
"bottom": null,
"display": null,
"flex": null,
"flex_flow": null,
"grid_area": null,
"grid_auto_columns": null,
"grid_auto_flow": null,
"grid_auto_rows": null,
"grid_column": null,
"grid_gap": null,
"grid_row": null,
"grid_template_areas": null,
"grid_template_columns": null,
"grid_template_rows": null,
"height": null,
"justify_content": null,
"justify_items": null,
"left": null,
"margin": null,
"max_height": null,
"max_width": null,
"min_height": null,
"min_width": null,
"object_fit": null,
"object_position": null,
"order": null,
"overflow": null,
"overflow_x": null,
"overflow_y": null,
"padding": null,
"right": null,
"top": null,
"visibility": null,
"width": "auto"
}
},
"11732868f38c4a3e8679a9431271fccb": {
"model_module": "@jupyter-widgets/base",
"model_name": "LayoutModel",
"model_module_version": "1.2.0",
"state": {
"_model_module": "@jupyter-widgets/base",
"_model_module_version": "1.2.0",
"_model_name": "LayoutModel",
"_view_count": null,
"_view_module": "@jupyter-widgets/base",
"_view_module_version": "1.2.0",
"_view_name": "LayoutView",
"align_content": null,
"align_items": null,
"align_self": null,
"border": null,
"bottom": null,
"display": null,
"flex": null,
"flex_flow": null,
"grid_area": null,
"grid_auto_columns": null,
"grid_auto_flow": null,
"grid_auto_rows": null,
"grid_column": null,
"grid_gap": null,
"grid_row": null,
"grid_template_areas": null,
"grid_template_columns": null,
"grid_template_rows": null,
"height": null,
"justify_content": null,
"justify_items": null,
"left": null,
"margin": null,
"max_height": null,
"max_width": null,
"min_height": null,
"min_width": null,
"object_fit": null,
"object_position": null,
"order": null,
"overflow": null,
"overflow_x": null,
"overflow_y": null,
"padding": null,
"right": null,
"top": null,
"visibility": null,
"width": null
}
},
"38af505ed6584720a1cfed391b85f243": {
"model_module": "@jupyter-widgets/controls",
"model_name": "DescriptionStyleModel",
"model_module_version": "1.5.0",
"state": {
"_model_module": "@jupyter-widgets/controls",
"_model_module_version": "1.5.0",
"_model_name": "DescriptionStyleModel",
"_view_count": null,
"_view_module": "@jupyter-widgets/base",
"_view_module_version": "1.2.0",
"_view_name": "StyleView",
"description_width": ""
}
},
"d6bb2d8d366c47bfbb6be9c6492f6685": {
"model_module": "@jupyter-widgets/base",
"model_name": "LayoutModel",
"model_module_version": "1.2.0",
"state": {
"_model_module": "@jupyter-widgets/base",
"_model_module_version": "1.2.0",
"_model_name": "LayoutModel",
"_view_count": null,
"_view_module": "@jupyter-widgets/base",
"_view_module_version": "1.2.0",
"_view_name": "LayoutView",
"align_content": null,
"align_items": null,
"align_self": null,
"border": null,
"bottom": null,
"display": null,
"flex": null,
"flex_flow": null,
"grid_area": null,
"grid_auto_columns": null,
"grid_auto_flow": null,
"grid_auto_rows": null,
"grid_column": null,
"grid_gap": null,
"grid_row": null,
"grid_template_areas": null,
"grid_template_columns": null,
"grid_template_rows": null,
"height": null,
"justify_content": null,
"justify_items": null,
"left": null,
"margin": null,
"max_height": null,
"max_width": null,
"min_height": null,
"min_width": null,
"object_fit": null,
"object_position": null,
"order": null,
"overflow": null,
"overflow_x": null,
"overflow_y": null,
"padding": null,
"right": null,
"top": null,
"visibility": null,
"width": null
}
},
"d91ef771417c446487f9ea53ba124564": {
"model_module": "@jupyter-widgets/controls",
"model_name": "DescriptionStyleModel",
"model_module_version": "1.5.0",
"state": {
"_model_module": "@jupyter-widgets/controls",
"_model_module_version": "1.5.0",
"_model_name": "DescriptionStyleModel",
"_view_count": null,
"_view_module": "@jupyter-widgets/base",
"_view_module_version": "1.2.0",
"_view_name": "StyleView",
"description_width": ""
}
},
"9311ffd4ace84173a83842dad4c94f58": {
"model_module": "@jupyter-widgets/base",
"model_name": "LayoutModel",
"model_module_version": "1.2.0",
"state": {
"_model_module": "@jupyter-widgets/base",
"_model_module_version": "1.2.0",
"_model_name": "LayoutModel",
"_view_count": null,
"_view_module": "@jupyter-widgets/base",
"_view_module_version": "1.2.0",
"_view_name": "LayoutView",
"align_content": null,
"align_items": null,
"align_self": null,
"border": null,
"bottom": null,
"display": null,
"flex": null,
"flex_flow": null,
"grid_area": null,
"grid_auto_columns": null,
"grid_auto_flow": null,
"grid_auto_rows": null,
"grid_column": null,
"grid_gap": null,
"grid_row": null,
"grid_template_areas": null,
"grid_template_columns": null,
"grid_template_rows": null,
"height": null,
"justify_content": null,
"justify_items": null,
"left": null,
"margin": null,
"max_height": null,
"max_width": null,
"min_height": null,
"min_width": null,
"object_fit": null,
"object_position": null,
"order": null,
"overflow": null,
"overflow_x": null,
"overflow_y": null,
"padding": null,
"right": null,
"top": null,
"visibility": null,
"width": null
}
},
"ef06999aabe84d94be23b6ada3369622": {
"model_module": "@jupyter-widgets/controls",
"model_name": "ButtonStyleModel",
"model_module_version": "1.5.0",
"state": {
"_model_module": "@jupyter-widgets/controls",
"_model_module_version": "1.5.0",
"_model_name": "ButtonStyleModel",
"_view_count": null,
"_view_module": "@jupyter-widgets/base",
"_view_module_version": "1.2.0",
"_view_name": "StyleView",
"button_color": null,
"font_weight": ""
}
},
"effd4367cf1742d7960488a538e6fe3b": {
"model_module": "@jupyter-widgets/base",
"model_name": "LayoutModel",
"model_module_version": "1.2.0",
"state": {
"_model_module": "@jupyter-widgets/base",
"_model_module_version": "1.2.0",
"_model_name": "LayoutModel",
"_view_count": null,
"_view_module": "@jupyter-widgets/base",
"_view_module_version": "1.2.0",
"_view_name": "LayoutView",
"align_content": null,
"align_items": null,
"align_self": null,
"border": null,
"bottom": null,
"display": null,
"flex": null,
"flex_flow": null,
"grid_area": "pathlist",
"grid_auto_columns": null,
"grid_auto_flow": null,
"grid_auto_rows": null,
"grid_column": null,
"grid_gap": null,
"grid_row": null,
"grid_template_areas": null,
"grid_template_columns": null,
"grid_template_rows": null,
"height": null,
"justify_content": null,
"justify_items": null,
"left": null,
"margin": null,
"max_height": null,
"max_width": null,
"min_height": null,
"min_width": null,
"object_fit": null,
"object_position": null,
"order": null,
"overflow": null,
"overflow_x": null,
"overflow_y": null,
"padding": null,
"right": null,
"top": null,
"visibility": null,
"width": "auto"
}
},
"0462c4711c214cafbd995cd97daf0fc7": {
"model_module": "@jupyter-widgets/controls",
"model_name": "DescriptionStyleModel",
"model_module_version": "1.5.0",
"state": {
"_model_module": "@jupyter-widgets/controls",
"_model_module_version": "1.5.0",
"_model_name": "DescriptionStyleModel",
"_view_count": null,
"_view_module": "@jupyter-widgets/base",
"_view_module_version": "1.2.0",
"_view_name": "StyleView",
"description_width": ""
}
},
"a29585effd9e4c39a8b16915b60b7bcd": {
"model_module": "@jupyter-widgets/base",
"model_name": "LayoutModel",
"model_module_version": "1.2.0",
"state": {
"_model_module": "@jupyter-widgets/base",
"_model_module_version": "1.2.0",
"_model_name": "LayoutModel",
"_view_count": null,
"_view_module": "@jupyter-widgets/base",
"_view_module_version": "1.2.0",
"_view_name": "LayoutView",
"align_content": null,
"align_items": null,
"align_self": null,
"border": null,
"bottom": null,
"display": "none",
"flex": null,
"flex_flow": null,
"grid_area": "filename",
"grid_auto_columns": null,
"grid_auto_flow": null,
"grid_auto_rows": null,
"grid_column": null,
"grid_gap": null,
"grid_row": null,
"grid_template_areas": null,
"grid_template_columns": null,
"grid_template_rows": null,
"height": null,
"justify_content": null,
"justify_items": null,
"left": null,
"margin": null,
"max_height": null,
"max_width": null,
"min_height": null,
"min_width": null,
"object_fit": null,
"object_position": null,
"order": null,
"overflow": null,
"overflow_x": null,
"overflow_y": null,
"padding": null,
"right": null,
"top": null,
"visibility": null,
"width": "auto"
}
},
"3da425b4936745f292657e8e96c12b88": {
"model_module": "@jupyter-widgets/controls",
"model_name": "DescriptionStyleModel",
"model_module_version": "1.5.0",
"state": {
"_model_module": "@jupyter-widgets/controls",
"_model_module_version": "1.5.0",
"_model_name": "DescriptionStyleModel",
"_view_count": null,
"_view_module": "@jupyter-widgets/base",
"_view_module_version": "1.2.0",
"_view_name": "StyleView",
"description_width": ""
}
},
"92c51dd4113e4bc3ab54a6158c46a346": {
"model_module": "@jupyter-widgets/base",
"model_name": "LayoutModel",
"model_module_version": "1.2.0",
"state": {
"_model_module": "@jupyter-widgets/base",
"_model_module_version": "1.2.0",
"_model_name": "LayoutModel",
"_view_count": null,
"_view_module": "@jupyter-widgets/base",
"_view_module_version": "1.2.0",
"_view_name": "LayoutView",
"align_content": null,
"align_items": null,
"align_self": null,
"border": null,
"bottom": null,
"display": null,
"flex": null,
"flex_flow": null,
"grid_area": "dircontent",
"grid_auto_columns": null,
"grid_auto_flow": null,
"grid_auto_rows": null,
"grid_column": null,
"grid_gap": null,
"grid_row": null,
"grid_template_areas": null,
"grid_template_columns": null,
"grid_template_rows": null,
"height": null,
"justify_content": null,
"justify_items": null,
"left": null,
"margin": null,
"max_height": null,
"max_width": null,
"min_height": null,
"min_width": null,
"object_fit": null,
"object_position": null,
"order": null,
"overflow": null,
"overflow_x": null,
"overflow_y": null,
"padding": null,
"right": null,
"top": null,
"visibility": null,
"width": "auto"
}
},
"9dcd0f7264434427bdbc58377520ef63": {
"model_module": "@jupyter-widgets/controls",
"model_name": "DescriptionStyleModel",
"model_module_version": "1.5.0",
"state": {
"_model_module": "@jupyter-widgets/controls",
"_model_module_version": "1.5.0",
"_model_name": "DescriptionStyleModel",
"_view_count": null,
"_view_module": "@jupyter-widgets/base",
"_view_module_version": "1.2.0",
"_view_name": "StyleView",
"description_width": ""
}
},
"63ae5e09c33442b9b4da7bcf68c984b4": {
"model_module": "@jupyter-widgets/base",
"model_name": "LayoutModel",
"model_module_version": "1.2.0",
"state": {
"_model_module": "@jupyter-widgets/base",
"_model_module_version": "1.2.0",
"_model_name": "LayoutModel",
"_view_count": null,
"_view_module": "@jupyter-widgets/base",
"_view_module_version": "1.2.0",
"_view_name": "LayoutView",
"align_content": null,
"align_items": null,
"align_self": null,
"border": null,
"bottom": null,
"display": null,
"flex": null,
"flex_flow": null,
"grid_area": null,
"grid_auto_columns": null,
"grid_auto_flow": null,
"grid_auto_rows": null,
"grid_column": null,
"grid_gap": null,
"grid_row": null,
"grid_template_areas": null,
"grid_template_columns": null,
"grid_template_rows": null,
"height": null,
"justify_content": null,
"justify_items": null,
"left": null,
"margin": null,
"max_height": null,
"max_width": null,
"min_height": null,
"min_width": "6em",
"object_fit": null,
"object_position": null,
"order": null,
"overflow": null,
"overflow_x": null,
"overflow_y": null,
"padding": null,
"right": null,
"top": null,
"visibility": null,
"width": "6em"
}
},
"76bb031bf7314e40b055772d8da19c48": {
"model_module": "@jupyter-widgets/controls",
"model_name": "ButtonStyleModel",
"model_module_version": "1.5.0",
"state": {
"_model_module": "@jupyter-widgets/controls",
"_model_module_version": "1.5.0",
"_model_name": "ButtonStyleModel",
"_view_count": null,
"_view_module": "@jupyter-widgets/base",
"_view_module_version": "1.2.0",
"_view_name": "StyleView",
"button_color": null,
"font_weight": ""
}
},
"f3b32187c9614e64b78389596bbbd418": {
"model_module": "@jupyter-widgets/base",
"model_name": "LayoutModel",
"model_module_version": "1.2.0",
"state": {
"_model_module": "@jupyter-widgets/base",
"_model_module_version": "1.2.0",
"_model_name": "LayoutModel",
"_view_count": null,
"_view_module": "@jupyter-widgets/base",
"_view_module_version": "1.2.0",
"_view_name": "LayoutView",
"align_content": null,
"align_items": null,
"align_self": null,
"border": null,
"bottom": null,
"display": "none",
"flex": null,
"flex_flow": null,
"grid_area": null,
"grid_auto_columns": null,
"grid_auto_flow": null,
"grid_auto_rows": null,
"grid_column": null,
"grid_gap": null,
"grid_row": null,
"grid_template_areas": null,
"grid_template_columns": null,
"grid_template_rows": null,
"height": null,
"justify_content": null,
"justify_items": null,
"left": null,
"margin": null,
"max_height": null,
"max_width": null,
"min_height": null,
"min_width": "6em",
"object_fit": null,
"object_position": null,
"order": null,
"overflow": null,
"overflow_x": null,
"overflow_y": null,
"padding": null,
"right": null,
"top": null,
"visibility": null,
"width": "6em"
}
},
"b87c98adaa3d472bbf87baf0f24f7388": {
"model_module": "@jupyter-widgets/controls",
"model_name": "ButtonStyleModel",
"model_module_version": "1.5.0",
"state": {
"_model_module": "@jupyter-widgets/controls",
"_model_module_version": "1.5.0",
"_model_name": "ButtonStyleModel",
"_view_count": null,
"_view_module": "@jupyter-widgets/base",
"_view_module_version": "1.2.0",
"_view_name": "StyleView",
"button_color": null,
"font_weight": ""
}
},
"4ba40e1613a94e268641303368d426b6": {
"model_module": "@jupyter-widgets/controls",
"model_name": "HTMLModel",
"model_module_version": "1.5.0",
"state": {
"_dom_classes": [],
"_model_module": "@jupyter-widgets/controls",
"_model_module_version": "1.5.0",
"_model_name": "HTMLModel",
"_view_count": null,
"_view_module": "@jupyter-widgets/controls",
"_view_module_version": "1.5.0",
"_view_name": "HTMLView",
"description": "",
"description_tooltip": null,
"layout": "IPY_MODEL_66d9b840498447dea0d0df823829ead6",
"placeholder": "",
"style": "IPY_MODEL_9f71bf8721e04cdaa31e54b5e725c669",
"value": "<span style=\"color:green;\">/content/drive/MyDrive/mp3/</span>"
}
},
"3c24ac8dd6be41bf8c96a51002c6764d": {
"model_module": "@jupyter-widgets/base",
"model_name": "LayoutModel",
"model_module_version": "1.2.0",
"state": {
"_model_module": "@jupyter-widgets/base",
"_model_module_version": "1.2.0",
"_model_name": "LayoutModel",
"_view_count": null,
"_view_module": "@jupyter-widgets/base",
"_view_module_version": "1.2.0",
"_view_name": "LayoutView",
"align_content": null,
"align_items": null,
"align_self": null,
"border": null,
"bottom": null,
"display": null,
"flex": null,
"flex_flow": null,
"grid_area": null,
"grid_auto_columns": null,
"grid_auto_flow": null,
"grid_auto_rows": null,
"grid_column": null,
"grid_gap": null,
"grid_row": null,
"grid_template_areas": null,
"grid_template_columns": null,
"grid_template_rows": null,
"height": null,
"justify_content": null,
"justify_items": null,
"left": null,
"margin": null,
"max_height": null,
"max_width": null,
"min_height": null,
"min_width": null,
"object_fit": null,
"object_position": null,
"order": null,
"overflow": "auto",
"overflow_x": null,
"overflow_y": null,
"padding": null,
"right": null,
"top": null,
"visibility": null,
"width": null
}
},
"66d9b840498447dea0d0df823829ead6": {
"model_module": "@jupyter-widgets/base",
"model_name": "LayoutModel",
"model_module_version": "1.2.0",
"state": {
"_model_module": "@jupyter-widgets/base",
"_model_module_version": "1.2.0",
"_model_name": "LayoutModel",
"_view_count": null,
"_view_module": "@jupyter-widgets/base",
"_view_module_version": "1.2.0",
"_view_name": "LayoutView",
"align_content": null,
"align_items": null,
"align_self": null,
"border": null,
"bottom": null,
"display": null,
"flex": null,
"flex_flow": null,
"grid_area": null,
"grid_auto_columns": null,
"grid_auto_flow": null,
"grid_auto_rows": null,
"grid_column": null,
"grid_gap": null,
"grid_row": null,
"grid_template_areas": null,
"grid_template_columns": null,
"grid_template_rows": null,
"height": null,
"justify_content": null,
"justify_items": null,
"left": null,
"margin": "0 0 0 1em",
"max_height": null,
"max_width": null,
"min_height": null,
"min_width": null,
"object_fit": null,
"object_position": null,
"order": null,
"overflow": null,
"overflow_x": null,
"overflow_y": null,
"padding": null,
"right": null,
"top": null,
"visibility": null,
"width": null
}
},
"9f71bf8721e04cdaa31e54b5e725c669": {
"model_module": "@jupyter-widgets/controls",
"model_name": "DescriptionStyleModel",
"model_module_version": "1.5.0",
"state": {
"_model_module": "@jupyter-widgets/controls",
"_model_module_version": "1.5.0",
"_model_name": "DescriptionStyleModel",
"_view_count": null,
"_view_module": "@jupyter-widgets/base",
"_view_module_version": "1.2.0",
"_view_name": "StyleView",
"description_width": ""
}
},
"0cc298d1db0645078d698b534a692b72": {
"model_module": "@jupyter-widgets/base",
"model_name": "LayoutModel",
"model_module_version": "1.2.0",
"state": {
"_model_module": "@jupyter-widgets/base",
"_model_module_version": "1.2.0",
"_model_name": "LayoutModel",
"_view_count": null,
"_view_module": "@jupyter-widgets/base",
"_view_module_version": "1.2.0",
"_view_name": "LayoutView",
"align_content": null,
"align_items": null,
"align_self": null,
"border": null,
"bottom": null,
"display": null,
"flex": null,
"flex_flow": null,
"grid_area": null,
"grid_auto_columns": null,
"grid_auto_flow": null,
"grid_auto_rows": null,
"grid_column": null,
"grid_gap": null,
"grid_row": null,
"grid_template_areas": null,
"grid_template_columns": null,
"grid_template_rows": null,
"height": null,
"justify_content": null,
"justify_items": null,
"left": null,
"margin": null,
"max_height": null,
"max_width": null,
"min_height": null,
"min_width": null,
"object_fit": null,
"object_position": null,
"order": null,
"overflow": null,
"overflow_x": null,
"overflow_y": null,
"padding": null,
"right": null,
"top": null,
"visibility": null,
"width": null
}
}
}
}
},
"cells": [
{
"cell_type": "markdown",
"metadata": {
"id": "view-in-github",
"colab_type": "text"
},
"source": [
"<a href=\"https://colab.research.google.com/gist/Hokila/c817fe1a30017983193f915380e73844/faster-whisper-to-txt-or-srt.ipynb\" target=\"_parent\"><img src=\"https://colab.research.google.com/assets/colab-badge.svg\" alt=\"Open In Colab\"/></a>"
]
},
{
"cell_type": "code",
"execution_count": 2,
"metadata": {
"id": "D5UD_f-zqd38",
"outputId": "a819e0fd-6ec3-4380-e8be-67985878c754",
"colab": {
"base_uri": "https://localhost:8080/",
"height": 1000,
"referenced_widgets": [
"0b86f4d3c48b48be839eb4a95b986d83",
"64d3d7f7c65d496c99d0dca212bba72a",
"6401cb1ee1dd4073879f4b3482f4daa7",
"097a498a7a63462d82afe1cb1eb7382f",
"f1996e6e68164de589b30bf358c041bf",
"41708c8224ec4b1892232c4f5c6c7b73",
"66c8d2a4584b4d19b6a399f6887d0726",
"eb18b7d7975342f3a00ad812320e7118",
"de237980eef04204b750953030ac861e",
"37cad5e13fbf4ea1b65b87606a6a2f08",
"6ef44ee6a981458f8e7b11dc0fb181d9",
"a45a76de0e86459b9138bc851e995218",
"3edfb40ed33d417c8ae7f54891d63ffe",
"974752bfd67b44b8bcc248fa43f701d3",
"f2938bd8f4af4b31a10dfb9c75fb4935",
"6eb589bdb4a141e894046a0b7fbfc4e4",
"5b13c3d01e5147279043d61c432adbbd",
"946916c7fd4c425c97858853ed8ff5a9",
"22ba55e216844bb28aaebfc997127d9e",
"a6d881538e5743d38a60f0bdcc81b068",
"e5b06037b89441329b44732b48571873",
"e6689bd88cc8403d84003f14cd8974ab",
"461bf72e9e264f20bc1446c316b92e5d",
"11732868f38c4a3e8679a9431271fccb",
"38af505ed6584720a1cfed391b85f243",
"d6bb2d8d366c47bfbb6be9c6492f6685",
"d91ef771417c446487f9ea53ba124564",
"9311ffd4ace84173a83842dad4c94f58",
"ef06999aabe84d94be23b6ada3369622",
"effd4367cf1742d7960488a538e6fe3b",
"0462c4711c214cafbd995cd97daf0fc7",
"a29585effd9e4c39a8b16915b60b7bcd",
"3da425b4936745f292657e8e96c12b88",
"92c51dd4113e4bc3ab54a6158c46a346",
"9dcd0f7264434427bdbc58377520ef63",
"63ae5e09c33442b9b4da7bcf68c984b4",
"76bb031bf7314e40b055772d8da19c48",
"f3b32187c9614e64b78389596bbbd418",
"b87c98adaa3d472bbf87baf0f24f7388",
"4ba40e1613a94e268641303368d426b6",
"3c24ac8dd6be41bf8c96a51002c6764d",
"66d9b840498447dea0d0df823829ead6",
"9f71bf8721e04cdaa31e54b5e725c669",
"0cc298d1db0645078d698b534a692b72"
]
}
},
"outputs": [
{
"output_type": "display_data",
"data": {
"text/plain": [
"VBox(children=(FileChooser(path='/content/drive/MyDrive', filename='', title='<b>選擇音訊資料夾</b>', show_hidden=Fal…"
],
"application/vnd.jupyter.widget-view+json": {
"version_major": 2,
"version_minor": 0,
"model_id": "0b86f4d3c48b48be839eb4a95b986d83"
}
},
"metadata": {}
},
{
"output_type": "stream",
"name": "stdout",
"text": [
"[11/42] 🎬 開始處理:21\n"
]
}
],
"source": [
"# 安裝必要套件\n",
"!pip install -q ipyfilechooser\n",
"!pip install -q faster-whisper\n",
"!apt-get -y install ffmpeg\n",
"\n",
"# 匯入套件\n",
"from google.colab import drive\n",
"from ipyfilechooser import FileChooser\n",
"from ipywidgets import widgets, VBox, HBox\n",
"from IPython.display import display, clear_output\n",
"from faster_whisper import WhisperModel\n",
"import shutil\n",
"import traceback\n",
"import re\n",
"import os\n",
"from concurrent.futures import ThreadPoolExecutor, as_completed\n",
"\n",
"# 掛載 Google Drive\n",
"drive.mount('/content/drive')\n",
"\n",
"# 初始化模型\n",
"model_size = \"large-v2\"\n",
"model = WhisperModel(model_size, device=\"cuda\", compute_type=\"float16\")\n",
"\n",
"# UI 元件\n",
"language_dropdown = widgets.Dropdown(\n",
" options=[('中文', 'zh'), ('English', 'en'), ('日本語', 'ja')],\n",
" value='zh',\n",
" description='語言:',\n",
")\n",
"\n",
"mode_dropdown = widgets.Dropdown(\n",
" options=[('srt 字幕檔', 'srt'), ('line by line', 'line')],\n",
" value='srt',\n",
" description='功能:',\n",
")\n",
"\n",
"fc = FileChooser('/content/drive/MyDrive')\n",
"fc.title = '<b>選擇音訊資料夾</b>'\n",
"fc.show_only_dirs = True\n",
"fc.use_dir_icons = True\n",
"\n",
"start_button = widgets.Button(\n",
" description='批次產生字幕',\n",
" button_style='success',\n",
" icon='check'\n",
")\n",
"\n",
"output = widgets.Output()\n",
"\n",
"base_output_dir = \"/content/drive/MyDrive/Subtitles\"\n",
"os.makedirs(base_output_dir, exist_ok=True)\n",
"\n",
"# 處理單一音訊檔\n",
"def transcribe_to_srt(index, total, audio_path, language, output_dir, mode):\n",
" try:\n",
" raw_file_name = os.path.splitext(os.path.basename(audio_path))[0]\n",
" cleaned_name = re.sub(r'\\s*\\[.*?\\]$', '', raw_file_name).strip()\n",
" srt_path = os.path.join(output_dir, f\"{cleaned_name}.srt\")\n",
" txt_path = os.path.join(output_dir, f\"{cleaned_name}.txt\")\n",
"\n",
" if os.path.exists(srt_path) or os.path.exists(txt_path):\n",
" return f\"[{index}/{total}] ⚠️ 略過:{cleaned_name} 字幕已存在\"\n",
"\n",
" print(f\"[{index}/{total}] 🎬 開始處理:{cleaned_name}\")\n",
"\n",
" prompt_map = {\n",
" \"zh\": \"請以繁體中文清楚說話。\",\n",
" \"en\": \"Speak clearly in English.\",\n",
" \"ja\": \"はっきりと日本語で話してください。\"\n",
" }\n",
" prompt = prompt_map.get(language, None)\n",
"\n",
" segments, _ = model.transcribe(audio_path, beam_size=5, initial_prompt=prompt, language=language)\n",
"\n",
" # 建立字幕內容\n",
" if mode == \"srt\":\n",
" text = \"\"\n",
" for i, segment in enumerate(segments, 1):\n",
" start_h, start_rem = divmod(segment.start, 3600)\n",
" start_m, start_s = divmod(start_rem, 60)\n",
" start_ms = round((segment.start - int(segment.start)) * 1000)\n",
" end_h, end_rem = divmod(segment.end, 3600)\n",
" end_m, end_s = divmod(end_rem, 60)\n",
" end_ms = round((segment.end - int(segment.end)) * 1000)\n",
"\n",
" text += \"%d\\n%02d:%02d:%02d,%03d --> %02d:%02d:%02d,%03d\\n%s\\n\\n\" % (\n",
" i,\n",
" int(start_h), int(start_m), int(start_s), int(start_ms),\n",
" int(end_h), int(end_m), int(end_s), int(end_ms),\n",
" segment.text\n",
" )\n",
" with open(srt_path, \"w\") as f:\n",
" f.write(text)\n",
" else: # line by line\n",
" text = \"\\n\".join([seg.text.strip() for seg in segments])\n",
" with open(txt_path, \"w\") as f:\n",
" f.write(text)\n",
"\n",
" # 刪除 mp3 原始檔\n",
" if audio_path.lower().endswith(\".mp3\"):\n",
" try:\n",
" os.remove(audio_path)\n",
" except Exception as e:\n",
" pass # 忽略刪除失敗\n",
"\n",
" return f\"[{index}/{total}] ✅ 完成:{cleaned_name}\"\n",
"\n",
" except Exception as e:\n",
" error_msg = traceback.format_exc()\n",
" return f\"[{index}/{total}] ❌ 錯誤處理 {os.path.basename(audio_path)}:\\n{error_msg}\"\n",
"\n",
"# 按鈕點擊處理\n",
"def on_button_click(b):\n",
" folder_path = fc.selected_path.strip() if fc.selected_path else ''\n",
" selected_lang = language_dropdown.value\n",
" selected_mode = mode_dropdown.value\n",
" output_dir = base_output_dir\n",
"\n",
" with output:\n",
" clear_output(wait=True)\n",
" if not os.path.isdir(folder_path):\n",
" print(\"❌ 資料夾不存在,請確認路徑!\")\n",
" return\n",
"\n",
" audio_exts = ['.mp3', '.wav', '.m4a', '.flac']\n",
" audio_files = [\n",
" os.path.join(folder_path, f)\n",
" for f in os.listdir(folder_path)\n",
" if os.path.splitext(f)[1].lower() in audio_exts\n",
" ]\n",
"\n",
" total = len(audio_files)\n",
" if total == 0:\n",
" print(\"⚠️ 找不到任何支援的音訊檔(.mp3, .wav, .m4a, .flac)\")\n",
" return\n",
"\n",
" print(f\"🔍 共找到 {total} 個音訊檔,開始處理...\\n\")\n",
"\n",
" results = [None] * total\n",
" with ThreadPoolExecutor(max_workers=4) as executor:\n",
" future_to_index = {\n",
" executor.submit(transcribe_to_srt, idx+1, total, audio_files[idx], selected_lang, output_dir, selected_mode): idx\n",
" for idx in range(total)\n",
" }\n",
"\n",
" for future in as_completed(future_to_index):\n",
" idx = future_to_index[future]\n",
" try:\n",
" results[idx] = future.result()\n",
" except Exception as e:\n",
" results[idx] = f\"[{idx+1}/{total}] ❌ 執行時例外:{str(e)}\"\n",
" print(results[idx]) # 用 print 顯示進度\n",
"\n",
" print(\"\\n✅ 所有字幕已儲存至:\", output_dir)\n",
"\n",
"# UI 顯示與事件綁定\n",
"start_button.on_click(on_button_click)\n",
"\n",
"clear_output(wait=True)\n",
"ui = VBox([\n",
" fc,\n",
" HBox([language_dropdown, mode_dropdown, start_button]),\n",
" output\n",
"])\n",
"display(ui)\n"
]
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment