Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
#### Pre-processing ####
# Read files
fnames <- list.files("mp3/", full.names = T, patt = "*.mp3")
# Write metadata for Kaggle dataset
ids <- str_extract(fnames, pattern = "[0-9]{4,}")
query$Path <- fnames[match(query$Recording_ID, ids)]
write.csv(query, "metadata.csv")
# Play random file - setWavPlayer in macOS if "permission denied"
setWavPlayer('/usr/bin/afplay')
play(sample(fnames, 1)) # esc to skip
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.