0

I am using spleeter python library to separate source from .mp3 audio files. I can separate source when using only one file but when I try to iterate through a number audio files using for loop it doesn't work. I am putting my code and error screenshot for you to look at.

from IPython.display import Audio
import spleeter

for item in path:
  !spleeter separate -o output/ {item}

This is code for separating source for single audio file

!spleeter separate -o output/ audio_example.mp3

I am using google Colab. error screenshot:

error screenshot

Salman
  • 1
  • 2
  • 1
    Can you paste all the errors rather than show the screenshot? The screenshot cuts off the full message. Can you also show the full code you're using? You have code like `for item in path` but what is `path`? – wkl Jun 25 '22 at 21:29
  • This is the error message that I get: Error: Invalid value for 'FILES...': File 'RagaDataset/Hindustani/audio/e771a74d-545d-41d5-816b-43403a818b0c/Kishori_Amonkar/Live_in_Concert:_Nehru_Center_Bombay/Raga_Bhoop_Vilambit_Teentaal_a3479fbe-fea4-4db7-9c1f-8b4ca613e5f0' does not exist. Usage: `spleeter` separate [OPTIONS] FILES... Try `spleeter` separate --help' for help. – Salman Jun 26 '22 at 20:13
  • It can't find the files, do they exist in the directory? – wkl Jun 26 '22 at 20:16
  • Path is list of paths to audio files for which I want to separate source. This is the code: ``` import spleeter import json with open('/content/drive/MyDrive/RagaDataset/Hindustani/_info_/path_mbid_ragaid.json','r') as f: data = json.load(f) path = [] for i in data: for j in data[i]: if j=='path': path.append(data[i][j]) ragaid =[] for i in data: for j in data[i]: if j=='ragaid': ragaid.append(data[i][j]) for item in path: !spleeter separate -o output/ {item} ``` – Salman Jun 26 '22 at 20:19
  • Yes they do exist in directory – Salman Jun 26 '22 at 20:20
  • This is help command given in documents: ``` !spleeter separate --help ``` – Salman Jun 26 '22 at 20:31

0 Answers0