Custom JSP taglib. Lets you develop text to speech (TTS) applications right in JSP pages.
The idea is very simple - for many applications you can create speech (sound file) from the pre-builded
fragments. E.g. your application informs users about some code (sequence of digits). You can use separate voice files
for the digits from 0 to 9 and concatenate them into sequence. Tag Concatenate does exactly this.
You can provide a list of wav files and tag concatenates them into one file (or streams the final file right
to the user). E.g. create file out.wav from 3 sound files:
<html> <%@ taglib uri="taglib.tld" prefix="t" %> <t:Concatenate target="out.wav"> <t:addFile>nine.wav</t:addFile> <t:addFile>one.wav</t:addFile> <t:addFile>one.wav</t:addFile> </c:Concatenate> </html> You can set concatenated files right in the tag's body, or provide a collection (enumeration, array) with file names.
Also you can stream the output to the user (just skip the attribute target):
<%@page contentType="audio/x-wav" %> <%@ taglib uri="taglib.tld" prefix="t" %> <t:Concatenate> <t:addFile>nine.wav</t:addFile> <t:addFile>one.wav</t:addFile> <t:addFile>one.wav</t:addFile> </c:Concatenate> just make sure that in this case your tag must be on the top of your page (no extra symbols including line breaks for binary content). Tags are: Concatenate. Body tag concatenates .wav files. Attributes are: 1) source - Optional attribute. Describes a collection (iterator, enumeration or array)
with file names for the concatenation.
addFile. Body tag describes a file for the concatenation. Attributes are: none for downloading: Library: ttstag.jar Description: taglib.tld See also Coldtags suite - the largest collection of custom JSP tags.
|
Also in Coldtags:
|