You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

202 lines
3.9 KiB

2 years ago
  1. {
  2. "cells": [
  3. {
  4. "cell_type": "markdown",
  5. "metadata": {
  6. "colab_type": "text",
  7. "id": "K6mcSc0mmp3i"
  8. },
  9. "source": [
  10. "# Install spleeter"
  11. ]
  12. },
  13. {
  14. "cell_type": "code",
  15. "execution_count": null,
  16. "metadata": {
  17. "colab": {
  18. "base_uri": "https://localhost:8080/",
  19. "height": 109
  20. },
  21. "colab_type": "code",
  22. "id": "f8Brdfh6mzEz",
  23. "outputId": "c63dae8e-1d33-48f2-879f-dd15393a5034"
  24. },
  25. "outputs": [],
  26. "source": [
  27. "!apt install ffmpeg"
  28. ]
  29. },
  30. {
  31. "cell_type": "code",
  32. "execution_count": null,
  33. "metadata": {
  34. "colab": {
  35. "base_uri": "https://localhost:8080/",
  36. "height": 1000
  37. },
  38. "colab_type": "code",
  39. "id": "V_6Ram1lmc1F",
  40. "outputId": "26a8df7b-6b6c-41e7-d874-acea0247d181"
  41. },
  42. "outputs": [],
  43. "source": [
  44. "pip install spleeter"
  45. ]
  46. },
  47. {
  48. "cell_type": "code",
  49. "execution_count": null,
  50. "metadata": {
  51. "colab": {},
  52. "colab_type": "code",
  53. "id": "W0LktyMypXqE"
  54. },
  55. "outputs": [],
  56. "source": [
  57. "from IPython.display import Audio"
  58. ]
  59. },
  60. {
  61. "cell_type": "markdown",
  62. "metadata": {
  63. "colab_type": "text",
  64. "id": "afbcUSken16L"
  65. },
  66. "source": [
  67. "# Separate from command line"
  68. ]
  69. },
  70. {
  71. "cell_type": "code",
  72. "execution_count": null,
  73. "metadata": {
  74. "colab": {
  75. "base_uri": "https://localhost:8080/",
  76. "height": 311
  77. },
  78. "colab_type": "code",
  79. "id": "O1kQaoJSoAD0",
  80. "outputId": "cd1868b4-6992-47c3-8a2b-920e6f288614"
  81. },
  82. "outputs": [],
  83. "source": [
  84. "!wget https://github.com/deezer/spleeter/raw/master/audio_example.mp3"
  85. ]
  86. },
  87. {
  88. "cell_type": "code",
  89. "execution_count": null,
  90. "metadata": {
  91. "colab": {
  92. "base_uri": "https://localhost:8080/",
  93. "height": 60
  94. },
  95. "colab_type": "code",
  96. "id": "ibG6uF55p4lH",
  97. "outputId": "f2785922-0ee1-4769-807a-6ee69313993c"
  98. },
  99. "outputs": [],
  100. "source": [
  101. "Audio('audio_example.mp3')"
  102. ]
  103. },
  104. {
  105. "cell_type": "code",
  106. "execution_count": null,
  107. "metadata": {
  108. "colab": {
  109. "base_uri": "https://localhost:8080/",
  110. "height": 660
  111. },
  112. "colab_type": "code",
  113. "id": "kOAqBcPhn6IU",
  114. "outputId": "23e14ad5-209d-4ed6-b909-7c0cd966bd0c"
  115. },
  116. "outputs": [],
  117. "source": [
  118. "!spleeter separate -h"
  119. ]
  120. },
  121. {
  122. "cell_type": "code",
  123. "execution_count": null,
  124. "metadata": {
  125. "colab": {
  126. "base_uri": "https://localhost:8080/",
  127. "height": 533
  128. },
  129. "colab_type": "code",
  130. "id": "dGL-k5xxoKbu",
  131. "outputId": "dd8d6a7f-515c-47f0-8388-39e179ef652a"
  132. },
  133. "outputs": [],
  134. "source": [
  135. "!spleeter separate -o output/ audio_example.mp3"
  136. ]
  137. },
  138. {
  139. "cell_type": "code",
  140. "execution_count": null,
  141. "metadata": {
  142. "colab": {
  143. "base_uri": "https://localhost:8080/",
  144. "height": 63
  145. },
  146. "colab_type": "code",
  147. "id": "IDuPWcAMoZP_",
  148. "outputId": "3f9a05fd-afab-41c7-d47c-433fc614283b"
  149. },
  150. "outputs": [],
  151. "source": [
  152. "!ls output/audio_example"
  153. ]
  154. },
  155. {
  156. "cell_type": "code",
  157. "execution_count": null,
  158. "metadata": {
  159. "colab": {
  160. "base_uri": "https://localhost:8080/",
  161. "height": 60
  162. },
  163. "colab_type": "code",
  164. "id": "e7CHpyiloxrk",
  165. "outputId": "d1ff17ac-8cef-4b9d-913a-01c2688ffef1"
  166. },
  167. "outputs": [],
  168. "source": [
  169. "Audio('output/audio_example/vocals.wav')"
  170. ]
  171. },
  172. {
  173. "cell_type": "code",
  174. "execution_count": null,
  175. "metadata": {
  176. "colab": {
  177. "base_uri": "https://localhost:8080/",
  178. "height": 60
  179. },
  180. "colab_type": "code",
  181. "id": "ibXd-WCTpT0w",
  182. "outputId": "6716708d-1cdb-4be5-da22-593075de78ca"
  183. },
  184. "outputs": [],
  185. "source": [
  186. "Audio('output/audio_example/accompaniment.wav')"
  187. ]
  188. }
  189. ],
  190. "metadata": {
  191. "colab": {
  192. "name": "spleeter.ipynb",
  193. "provenance": []
  194. },
  195. "kernelspec": {
  196. "display_name": "Python 3",
  197. "name": "python3"
  198. }
  199. },
  200. "nbformat": 4,
  201. "nbformat_minor": 0
  202. }