This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#### 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