Steve Cassidy
SHLRC, Macquarie University
In order to promote interoperability between speech annotation tools we are working towards an abstract programing interface for signal display widgets in such tools. This API is intended to provide all of the required controls on signal displays as well as to provide for feedback from display widgets of things like cursor motion, region selection and playback progress. The API was developed in discussion with Steven Bird of LDC and Claude Barraas of LIMSI.
This page describes a sample implementation of the API in Tcl/Tk using the display widgets provided by our Emu system and the Wavesurfer/Snack toolkits from KTH. Although this implementation uses Tcl, the intention of the API design is that display widgets may be written in or controlled from any language.
The API makes use of a number of display concepts:
This API should be implemented by any signal display widget that is to be integrated into a conformant system. In order to provide complete functionality, widgets also need to provide callbacks when certain events occur via their own user interface. These callbacks have the same API as the widgets themselves and should be generated in the following circumstances:
A standard method of initiating callbacks needs to be defined but this is likely to be language and implementation dependent.
A sample implementation using Tcl/Tk, Incr Tcl, IWidgets and Emu is available from the Emu CVS repository with the commands:
cvs -d:pserver:anonymous@cvs.emu.sourceforge.net:/cvsroot/emu login cvs -z3 -d:pserver:anonymous@cvs.emu.sourceforge.net:/cvsroot/emu co tbdisplay
Please let me know if you can't access cvs and would like a copy of the latest sources.
The sample implementation is written as an Incr Tcl wrapper around various signal display widgets from the Emu system. In this implementation, a master widget is used to control one or more display widgets. A master supports the same API as the display widgets and coordinates the actions of it's subordinate widgets, for example it might synchronise cursor movement or zooming of the displays. An abstract TBMaster class is provided along with a TBPanedMaster class which displays individual widgets as panes in a larger window.
The TBMaster class supports the manage method which instructs it to manage a new display widget. A simple demonstration program is as follows:
set master [TBPanedMaster .top]
set g1 [wsurfdisplay .t]
set g2 [trackdisplay .t2]
$master manage $g1
$master manage $g2
pack $master -expand 1 -fill both
$g1 Load /home/steve/kutu21w.wav
$g2 Load /home/steve/kutu21w.wav
$master SetView 0 0
Here wsurfdisplay and trackdisplay are procedures which create individual display widgets. Note that in the current implementation signals must be loaded into the display widgets, this should be coordinated by the master in some way; in Emu the master would need an utterance name and could resolve this into a file name for the kind of data displayed by each widget using the database template.
The master configures each widget with a callback option which is then used by the widget to invoke the API of the master. For example the TBMaster class issues:
$widget configure -callback "$this callback $widget"
and the TrackDisplay widget uses this to inform the master that the region has changed (this procedure is bound to a mouse click in the display widget):
body TrackDisplay::start_region {x} {
set regionanchor $x
SetRegion $regionanchor $regionanchor
eval $itk_option(-callback) SetRegion $regionanchor $regionanchor
}
Here's a snapshot of the above application showing the wavesurfer widget and the emu track widget displaying the same waveform with a synchronised cursor:

Copyright © 2001 Steve Cassidy