<!ELEMENT mediaitem (#PCDATA | promptdoc)*> <!ATTLIST mediaitem mimetype CDATA #IMPLIED charset CDATA #IMPLIED src CDATA #IMPLIED alt CDATA #IMPLIED autoplay CDATA #IMPLIED modal CDATA #IMPLIED width CDATA #IMPLIED height CDATA #IMPLIED volume CDATA #IMPLIED annotationTemplate CDATA #IMPLIED languageISO639code CDATA #IMPLIED countryISO3166code CDATA #IMPLIED > |
All attributes are optional.
mimetype specifies the type of prompt item. For image and audio prompts, this attribute provides a hint for displaying the prompt item – image items are drawn on the screen, audio is played via the system speakers or a headphone. Default MIME type is text/plain. charset Charset of external text prompt file. The encoding of prompt text embedded in teh recording script is inherited from the encoding of the entire recording script which is by default UTF-8. src is a file name or a URL from which a prompt item is retrieved.
alt contains the text that is displayed if the item cannot be retrieved from the external source.
autoplay, modal and volume apply only to time-dependent prompt items, i.e. audio clips. If autoplay is set to yes the clip plays automatically as soon as the item is displayed, otherwise the user has to start playback explicitly. With modal set to yes item playback cannot be interrupted, and volume determines the audio volume for playback.
width and height specify the width and height in pixels of the image or video to display.
It is up to the recording script author to set the mediaitem attribute values to meaningful values. SpeechRecorder accepts the combinations given in table 1.8.
|
An audio <mediaitem> element without contents displays a generic symbol for audio playback. An audio <mediaitem> element combined with text or image media displays the text or image contents and plays back the audio.
The MIME type text/x-prompt is not an official MIME type. This type is only defined and usable in SpeechRecorder to display formatted text prompts.
The formatted text is described by a structure of some XML elements. The DTD definitions of this elements defined in DTD (since version 4) are:
<!ELEMENT promptdoc (body?)> <!ELEMENT body (p)*> <!ELEMENT p (text | font | br)*> <!ELEMENT text (#PCDATA)> <!ATTLIST text decoration CDATA #IMPLIED> <!ATTLIST text color CDATA #IMPLIED> <!ELEMENT font (text)> <!ATTLIST font size CDATA #IMPLIED> <!ATTLIST font style CDATA #IMPLIED> <!ATTLIST font weight CDATA #IMPLIED> <!ELEMENT br EMPTY> |
The root element <promptdoc> of the prompt text document must be a child element of the <mediaitem> element. the <body> element contains the document structure: A paragraph is represented by the <p> element. Text must always be encapsulated by <text> elements. To use different font settings as the default settings defined by the project configuration the <text> elements can be enclosed by <font> elements. The attributes size,style and weight define the font to use. The lien break <br/> element forces a new line.
<mediaitem mimetype="text/plain">
Welcome to the SpeechRecorder Demo Script.
</mediaitem>
|
This <mediaitem> element shows a formatted text loaded from a file:
<mediaitem mimetype="text/rtf" src="promptText.rtf" /> |
Note: RTF prompts only work on Windows operating systems.
This <mediaitem> element shows an image loaded from a relative (to the project directory) URL:
<mediaitem mimetype="image/jpeg" src="images/FelixWas.jpg" alt="Boy and washing machine" /> |
This <mediaitem> element shows an image loaded from a absolute URL:
<mediaitem mimetype="image/jpeg" src="http://www.speechrecorder.org/prompts/images/FelixWas.jpg" alt="Boy and washing machine" /> |
Formatted text prompts:
The following prompt should look almost the same as a plain text prompt:
<mediaitem mimetype="text/x-prompt">
<promptdoc>
<body>
<p>
<text>Welcome to SpeechRecorder Demo Script.</text>
</p>
</body>
</promptdoc>
</mediaitem>
|
An often requested feature was the possibility to force a new line in the prompt. This can now be achieved with the line break <br/> element:
<mediaitem mimetype="text/x-prompt"> <promptdoc> <body> <p> <text>Welcome to SpeechRecorder Demo Script.</text> <br/> <text>How are you?</text> </p> </body> </promptdoc> </mediaitem> |
Often there is also the requirement to emphasize parts of the prompt text, in the following examples the word apple:
Underlined:
<mediaitem mimetype="text/x-prompt"> <promptdoc> <body> <p> <text>She planted an </text> <text decoration="underline">apple</text> <text> tree in her garden.</text> </p> </body> </promptdoc> </mediaitem> |
Colored (green):
<mediaitem mimetype="text/x-prompt">
<promptdoc>
<body>
<p>
<text>She planted an </text>
<text color="green">apple</text>
<text> tree in her garden.</text>
</p>
</body>
</promptdoc>
</mediaitem>
|
Use font settings:
Increase font size (by 150%):
<mediaitem mimetype="text/x-prompt"> <promptdoc> <body> <p> <text>She planted an </text> <font size="150.0%"> <text>apple</text> </font> <text> tree in her garden.</text> </p> </body> </promptdoc> </mediaitem> |
Italic font:
<mediaitem mimetype="text/x-prompt"> <promptdoc> <body> <p> <text>She planted an </text> <font style="italic"> <text>apple</text> </font> <text> tree in her garden.</text> </p> </body> </promptdoc> </mediaitem> |
Combine underline decoration, green text, font size 150% and italic style:
<mediaitem mimetype="text/x-prompt">
<promptdoc>
<body>
<p>
<text>She planted an </text>
<font size="150%" style="italic">
<text color="green" decoration="underline">apple</text>
</font>
<text> tree in her garden.</text>
</p>
</body>
</promptdoc>
</mediaitem>
|
If you plan to use EMU-SDMS to annotate and analyze your recordings later you may mark a text media prompt item as annotation template. This means that the speaker is expected to read the prompt txt. If you export your project as an EMU-DB when the recordings are finished, the prompt text will appear in the TPL level of the exported database.
<recording itemcode="demo_031" postrecdelay="500" prerecdelay="2000" recduration="10000"> <recinstructions mimetype="text/plain">Lisez la phrase</recinstructions> <recprompt> <mediaitem annotationTemplate="true" languageISO639code="fr">A Paris il y a 14 lignes de mtro dont 9 traversent la Seine.</mediaitem> </recprompt> <reccomment> French sentence: In Paris there are 14 metro lines, 9 of which cross the Seine. </reccomment> </recording> |
If the expected spoken word(s) differ from the prompt a separate XML element ’annotationtemplate’ for the annotation template is required. For example:
<recording itemcode="demo_022" postrecdelay="500" prerecdelay="2000" recduration="10000">
<recinstructions mimetype="text/plain">Bitte ergnzen Sie</recinstructions>
<recprompt>
<mediaitem languageISO639code="de">Morgenstund hat ...</mediaitem>
</recprompt>
<annotationtemplate languageISO639code="de">Gold im Mund</annotationtemplate>
</recording>
|
Note: The optional attribute languageISO639code indicates the language of the template text as ISO639 code.