1.6 The <mediaitem> element

The <mediaitem> element decsribes a media item. It may be empty, or contain text which is displayed on the screen.
 <!ELEMENT mediaitem (#PCDATA)*>
 
 <!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
 >

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.6.


mimetype src altautoplaymodalwidthheightvolume
text/plain
text/html URL
text/rtf URL
image/jpeg URL + + +
image/svg+xmlURL + + +
audio/x-wave URL + + + +


Table 1Meaningful <mediaitem> attribute combinations.

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.

<mediaitem> sample
The following <mediaitem> element displays a text prompt:
 <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" />