We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
python3 dataset_utils.py File "dataset_utils.py", line 187 else: ^ SyntaxError: invalid syntax
sliced.export(audioset_dir+'/Audio/yvid__'+r['id']+'__'+str(label)+'.wav', format="wav") else: print(yid+': Already exists!')
if name == "main": #logger = configure_logging() main()
The text was updated successfully, but these errors were encountered:
I had to re-indent the file, as the formatting got screwed up somehow and python is sensitive to indentation levels. My code looks like:
def download_youtube_audio(yid, start, end, label): ydl_opts = { 'format': 'bestaudio/best', 'postprocessors': [{ 'key': 'FFmpegExtractAudio', 'preferredcodec': 'wav', 'preferredquality': '192', }], } youtube_url_base = 'https://youtu.be' if label is not None: ydl_opts["outtmpl"] = audioset_dir + '/Audio/yvid__%(id)s__' + str(label) + '.%(ext)s' # Join URL elements as in `youtu.be/m55Fx5rDh8g?start=50&end=60` youtube_url = youtube_url_base + '/' + yid + '?start=' + str(start) + '&end=' + str(end) r = None with youtube_dl.YoutubeDL(ydl_opts) as ydl: ydl.download([youtube_url]) r = ydl.extract_info(youtube_url, download=False) audiofile = AudioSegment.from_wav(audioset_dir + '/Audio/yvid__' + r['id'] + '__' + str(label) + '.wav') sliced = audiofile[int(float(row[1]) * 1000):int(float(row[2]) * 1000)] sliced.export(audioset_dir + '/Audio/yvid__' + r['id'] + '__' + str(label) + '.wav', format="wav") else: print(yid + ': Already exists!')
Now I need to find the main() which looks to be missing.
main()
Sorry, something went wrong.
No branches or pull requests
python3 dataset_utils.py
File "dataset_utils.py", line 187
else:
^
SyntaxError: invalid syntax
if name == "main":
#logger = configure_logging()
main()
The text was updated successfully, but these errors were encountered: