splitw {voice} | R Documentation |
Split Wave
Description
Split WAV files either in fromWav
directory or using (same names) RTTM files/subdirectories as guidance.
Usage
splitw(
fromWav,
fromRttm = NULL,
toSplit = NULL,
autoDir = FALSE,
subDir = FALSE,
output = "wave",
filesRange = NULL,
full.names = TRUE,
recursive = FALSE,
silence.gap = 0.5
)
Arguments
fromWav |
Either WAV file or directory containing WAV files. |
fromRttm |
Either RTTM file or directory containing RTTM files. Default: |
toSplit |
A directory to write generated files. Default: |
autoDir |
Logical. Must the directories tree be created? Default: |
subDir |
Logical. Must the splitted files be placed in subdirectories? Default: |
output |
Character string, the class of the object to return, either 'wave' or 'list'. |
filesRange |
The desired range of directory files (default: |
full.names |
Logical. If |
recursive |
Logical. Should the listing recursively into directories? (default: |
silence.gap |
The silence gap (in seconds) between adjacent words in a keyword. Rows with |
Details
When autoDir = TRUE
, the following directories are created: '../mp3'
,'../rttm'
, '../split'
and '../musicxml'
. Use getwd()
to find the parent directory '../'
.
Value
Splited audio files according to the correspondent RTTM file(s). See 'voice::diarize
'.
See Also
voice::diarize
Examples
## Not run:
library(voice)
urlWav <- 'https://raw.githubusercontent.com/filipezabala/voiceAudios/main/wav/sherlock0.wav'
destWav <- paste0(tempdir(), '/sherlock0.wav')
download.file(urlWav, destfile = destWav)
urlRttm <- 'https://raw.githubusercontent.com/filipezabala/voiceAudios/main/rttm/sherlock0.rttm'
destRttm <- paste0(tempdir(), '/sherlock0.rttm')
download.file(urlRttm, destfile = destRttm)
splitDir <- paste0(tempdir(), '/split')
dir.create(splitDir)
splitw(destWav, fromRttm = destRttm, toSplit = splitDir)
dir(splitDir)
## End(Not run)