Warning: session_start(): open(/var/lib/php/sessions/sess_nqhl3oroet2i6db43u07ccje8q, O_RDWR) failed: No space left on device (28) in /var/www/tb-usercake/models/config.php on line 51
Warning: session_start(): Failed to read session data: files (path: /var/lib/php/sessions) in /var/www/tb-usercake/models/config.php on line 51
!7
set flag DynModule.
sclass Recording {
File file, clippedFile;
double clippedLength;
S text;
}
sclass AudioRecordings extends DynObjectTable {
start {
itemToMap = func(Recording r) -> Map {
litorderedmap(
Name := fileName(r.file),
"Clipped length" := r.clippedLength == 0 ? "" : formatDouble(r.clippedLength, 1) + " s",
Word := r.text)
};
setData(map(allRecordings(), func(File f) -> Recording {
nu(Recording,
file := f,
clippedFile := fileIfExists(fileInSubDir(f, "clipped")),
text := wordFromAudioFileName(f.getName()))
}));
thread "Get Clip Lengths" {
bool change;
for (Recording r : data)
if (r.clippedLength == 0) pcall-short {
double l = lengthOfWAVInSeconds(r.clippedFile);
if (l != 0) { set change; r.clippedLength = l; }
}
if (change) updateTable();
}
}
}