Created
March 28, 2020 18:26
-
-
Save monogenea/b37668d3e8b838073a937a096a2f27c3 to your computer and use it in GitHub Desktop.
This file contains hidden or 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