The EMU-SDMS has a unique approach to its GUI in that it utilizes a web application as its primary GUI. This is known as the EMU-webApp . The EMU-webApp is a fully fledged browser-based labeling and correction tool that offers a multitude of labeling and visualization features. These features include unlimited undo/redo, formant correction capabilities, the ability to snap a preselected boundary to the nearest top/bottom boundary, snap a preselected boundary to the nearest zero crossing, and many more. The web application is able to render everything directly in the user’s browser, including the calculation and rendering of the spectrogram, as it is written entirely using HTML, CSS and JavaScript. This means it can also be used as a standalone labeling application, as it does not require any server-side calculations or rendering. Further, it is designed to interact with any websocket server that implements the EMU-webApp websocket protocol (see Section ). This enables it to be used as a labeling tool for collaborative annotation efforts. Also, as the EMU-webApp is cached in the user’s browser on the first visit, it does not require any internet connectivity to be able to access the web application unless the user explicitly clears the browser’s cache. The URL of the current live version of the EMU-webApp is: http://ips-lmu.github.io/EMU-webApp/.
Main layout
The main screen of the EMU-webApp can be split into five areas. Figure shows a screenshot of the EMU-webApp’s main screen displaying these five areas while displaying a bundle of the ae demo database. This database is served to the by invoking the serve()
command as shown in R Example . The left side bar (area marked 1 in Figure ) represents the bundle list side bar which, if connected to a database, displays the currently available bundles grouped by their sessions. The top and bottom menu bars (areas marked 2 and 5 in Figure ) display the currently available menu options, where the bottom menu bar contains the audio navigation and playback controls and also includes a scrollable mini map of the oscillogram. Area 3 of Figure displays the signal canvas area currently displaying the oscillogram and the spectrogram. Other signal contours such as formant frequency contours and fundamental frequency contours are also displayed in this area. Area 4 of Figure displays the area in which levels containing time information are displayed. It is worth noting that the main screen of the EMU-webApp does not display any levels that do not contain time information. The hierarchical annotation can be displayed and edited by clicking the show hierarchy
button in the top menu bar (see Figure for an example of how the hierarchy is displayed).
# serve ae emuDB to EMU-webApp
serve(ae)
Configuring the EMU-webApp
This section will give an overview of how the EMU-webApp can be configured. The configuration of the EMU-webApp is stored in the EMUwebAppConfig
section of the _DBconfig.json
of an emuDB (see Appendix for details). This means that the EMU-webApp can be configured separately for every emuDB. Although it can be necessary for some advanced configuration options to manually edit the _DBconfig.json
using a text editor (see Section ), the most common configuration operations can be achieved using functions provided by the emuR package (see Section ).
A central concept for configuring the EMU-webApp are so-called perspective
s. Essentially, a perspective
is an independent configuration of how the EMU-webApp displays a certain set of data. Having multiple perspective
s allows the user to switch between different views of the data. This can be especially useful when dealing with complex annotations where only showing certain elements for certain labeling tasks can be beneficial. Figure displays a screenshot of the perspective
s side bar menu of the EMU-webApp which displays the three perspective
s of the ae emuDB. The default perspective displays both the Phonetic and the Tone levels where as the Phonetic-only and the Tone-only only display these levels individually.
Basic configurations using emuR
R Example shows how to create and load the demo data that will be used throughout the rest of this chapter.
# load package
library(emuR)
# create demo data in directory provided by tempdir()
create_emuRdemoData(dir = tempdir())
# create path to demo database
path2ae = file.path(tempdir(), "emuR_demoData", "ae_emuDB")
# load database
ae = load_emuDB(path2ae, verbose = F)
As mentioned above, the EMU-webApp subdivides different ways to look at an emuDB into so-called perspective
s. Users can switch between these perspective
s in the web application. They contain, for example, information on what levels are displayed, which SSFF tracks are drawn. R Example shows how the current perspective
s can be listed using the list_perspectives()
function.
# list perspectives of ae emuDB
list_perspectives(ae)
## name signalCanvasesOrder levelCanvasesOrder
## 1 default OSCI; SPEC Phonetic; Tone
## 2 Phonetic-only OSCI; SPEC Phonetic
## 3 Tone-only OSCI; SPEC Phonetic
As it is sometimes necessary to add new or remove existing perspectives to or from a database, R Example shows how this can be achieved using emuR’s add/remove_perspective()
functions.
# add new perspective to ae emuDB
add_perspective(ae,
name = "tmpPersp")
# show added perspective
list_perspectives(ae)
## name signalCanvasesOrder levelCanvasesOrder
## 1 default OSCI; SPEC Phonetic; Tone
## 2 Phonetic-only OSCI; SPEC Phonetic
## 3 Tone-only OSCI; SPEC Phonetic
## 4 tmpPersp OSCI; SPEC
# remove newly added perspective
remove_perspective(ae,
name = "tmpPersp")
Signal canvas and level canvas order
As mentioned above, R Example shows that the ae emuDB contains three perspectives. The first perspective (default) displays the oscillogram (OSCI
) followed by the spectrogram (SPEC
) in the signal canvas area (area 3 of Figure ) and the Phonetic and Tone levels in the level canvas area (area 4 of Figure ). It is worth noting that OSCI
(oscillogram) and SPEC
(spectrogram) are predefined signal tracks that are always available. This is indicated by the capital letters indicating that they are predefined constants. R Example shows how the order of the signal canvases and level canvases can be changed using the get/set_signalCanvasesOrder()
and get/set_levelCanvasesOrder()
.
# get order vector of signal canvases of default perspective
sco = get_signalCanvasesOrder(ae,
perspectiveName = "default")
# show sco vector
sco
## [1] "OSCI" "SPEC"
# reverse sco order
# using R's rev() function
scor = rev(sco)
# set order vector of signal canvases of default perspective
set_signalCanvasesOrder(ae,
perspectiveName = "default",
order = scor)
# set order vector of level canvases of default perspective
# to only display the "Tone" level
set_levelCanvasesOrder(ae,
perspectiveName = "default",
order = c("Tone"))
# list perspectives of ae emuDB
# to show changes
list_perspectives(ae)
## name signalCanvasesOrder levelCanvasesOrder
## 1 default SPEC; OSCI Tone
## 2 Phonetic-only OSCI; SPEC Phonetic
## 3 Tone-only OSCI; SPEC Phonetic
After the changes made in R Example , the default perspective will show the spectrogram above the oscillogram in the signal canvas area and only the Tone level in the level canvas area. Only levels with time information are allowed to be displayed in the level canvas area, and the set_levelCanvasesOrder()
will print an error if a level of type ITEM
is added (see R Example ).
# set level canvas order where a
# level is passed into the order parameter
# that is not of type EVENT or SEGMENT
set_levelCanvasesOrder(ae,
perspectiveName = "default",
order = c("Syllable"))
## Error in set_levelCanvasesOrder(ae, perspectiveName = "default", order = c("Syllable")): levelDefinition with name 'Syllable' is not of type 'SEGMENT' or 'EVENT'
The same mechanism used above can also be used to display any SSFF track that is defined for the database by referencing its name. R Example shows how the existing SSFF track called fm (containing formant values calculated by wrassp’s forest()
function) can be added to the signal canvas area.
# show currently available SSFF tracks
list_ssffTrackDefinitions(ae)
## name columnName fileExtension
## 1 dft dft dft
## 2 fm fm fms
# re-set order vector of signal canvases of default perspective
# by appending the fm track
set_signalCanvasesOrder(ae,
perspectiveName = "default",
order = c(scor, "fm"))
A screenshot of the current display of the default perspective can be seen in Figure .
Advanced configurations made by editing the _DBconfig.json
Although the above configuration options cover the most common use cases, the EMU-webApp offers multiple other configuration options that are currently not configurable via functions provided by emuR. These advanced configuration options can currently only be achieved by manually editing the _DBconfig.json
file using a text editor. As even the colors used in the EMU-webApp and every keyboard shortcut can be reconfigured, here we will focus on the more common advanced configuration options. A full list of the available configuration fields of the EMUwebAppConfig
section of the _DBconfig.json
including their meaning, can be found in Appendix .
Overlaying signal canvases
To save space it can be beneficial to overlay one or more signal tracks onto other signal canvases. This can be achieved by manually editing the assign
array of the EMUwebAppConfig:perspectives[persp_idx]:signalCanvases
field in the _DBconfig.json
. Listing shows an example configuration that overlays the fm track on the oscillogram where the OSCI
string can be replaced by any other entry in the EMUwebAppConfig:perspectives[persp_idx]:signalCanvases:order]
array. Figure displays a screenshot of such an overlay.
...
"assign": [{
"signalCanvasName": "OSCI",
"ssffTrackName": "fm"
}],
...
2D canvas
The EMU-webApp has an additional canvas which can be configured to display two-dimensional data. Figure shows a screenshot of the 2D canvas, which is placed in the bottom right hand corner of the level canvas area of the web application. The screenshot shows data representing EMA sensor positions on the mid sagittal plane. Listings shows how the 2D canvas can be configured. Essentially, every drawn dot is configured by assigning a column in an SSFF track that specifies the X values and an additional column that specifies the Y values.
...
"twoDimCanvases": {
"order": ["DOTS"],
"twoDimDrawingDefinitions": [{
"name": "DOTS",
"dots": [{
"name": "tt",
"xSsffTrack": "tt_posy",
"xContourNr": 0,
"ySsffTrack": "tt_posz",
"yContourNr": 0,
"color": "rgb(255,0,0)"
},
...
"connectLines": [{
"fromDot": "tt",
"toDot": "tm",
"color": "rgb(0,0,0)"
},
...
EPG
The 2D canvas of the EMU-webApp can also be configured to display EPG data as displayed in Figure . The SSFF file containing the EPG data has to be formated in a specific way. The format is a set of eight bytes per point in time, where each byte represents a row of electrodes on the artificial palate. Each binary bit value per byte indicates whether one of the eight sensors is activated or not (i.e., tongue contact was measured). If data in this format and an SSFF track with the predefined name EPG referencing the SSFF files are present, the 2D canvas can be configured to display this data by adding the EPG to the twoDimCanvases:order
array as shown in Listing .
"twoDimCanvases": {
"order": ["EPG"]
}
EMA gestural landmark recognition
The EMU-webApp can also be configured to semi-automatically detect gestural landmarks of EMA contours. The functions implemented in the EMU-webApp are based on various Matlab scripts by Phil Hoole. For a description of which gestural landmarks are detected and how these are detected, see page 61 ff.
Compared to the above configurations, configuring the EMU-webApp to semi-automatically detect gestural landmarks of EMA contours is done as part of the level definition’s configuration entries of the _DBconfig.json
. Listing shows the anagestConfig
entry, which configures the tongueTipGestures event level for this purpose. Within the web application this level has to be preselected by the user and a region containing a gesture in the SSFF track selected (left click and drag). Hitting the ENTER
/RETURN
key then executes the semi-automatic gestural landmark recognition functions. If multiple candidates are recognized for certain landmarks, the user will be prompted to select the appropriate landmark.
...
"levelDefinitions": [{
{
"name": "tongueTipGestures",
"type": "EVENT",
"attributeDefinitions": [{
"name": "tongueTipGestures",
"type": "STRING"
}],
"anagestConfig": {
"verticalPosSsffTrackName": "tt_posz",
"velocitySsffTrackName": "t_tipTV",
"autoLinkLevelName": "ORT",
"multiplicationFactor": 1,
"threshold": 0.2,
"gestureOnOffsetLabels": ["gon", "goff"],
"maxVelocityOnOffsetLabels": ["von", "voff"],
"constrictionPlateauBeginEndLabels": ["pon", "poff"],
"maxConstrictionLabel": "mon"
}
...
The user will be prompted to select an annotation item of the level specified in anagestConfig:autoLinkLevelName
once the gestural landmarks are recognized. The EMU-webApp then automatically links all gestural landmark events to that item.