Description
"data-vfact-read" attribute allows to set custom text/external sound for a part of the text.
Content of the attribute is set in following form: "#FORMAT: DATA".
Supported formats:
- "T": DATA contains a custom text, see #285
- "S": DATA contains an url to external sound, see #347
- "V": DATA contains pitch and/or speed and/or voice_id, see #348
Example of custom text:
In both cases, Text1 is played instead Text2.
Text2
Text2
Variant "Text1" is deprecated, customers should specify format directly: "#T: Text1"
Example of using external sound file:
File "http://some.external.mp3" will be played, Text2 won't be played.
Text2
If external file doesn't exist, it will be just skipped and next part of the text will be played
Example of setting custom value of pitch/speed/voice:
Text3
Text3
Text3
#348: Set custom pitch/speed/voice values for selected HTML-nodes
Pitch
Pitch 1 aaa
Pitch 1
Pitch 2
Pitch 3
P=1
P=2
P=3
Speed
Speed 10 aaa
Speed 10
Speed 5 aaa
Speed 5
Speed 0
Speed -5
Speed -10
Speed -10 s
Speed -5 s
Speed 0 s
Speed 5 s
Speed 10 s
Pitch, speed, voice (with ids)
Voice 18 en
Voice 18 en, speed -10
Voice 18 en, speed -5, pitch 1
Voice 18 en, speed -5, pitch 3
Voice 31 en
Voice 31 en, speed 5
Voice 31 en, speed 5, pitch 3
Voice 31 en, speed 5, pitch 1
Voice 31 en, speed 5, pitch 2
Voice 18 en, speed 5, pitch 2
Pitch, speed, voice (with voice tags)
Dette er et eksempel på tekst - Mette, dansk
This is example of voice Lucy, English en, speed 0
Voice Lucy, English, speed 5, pitch 1
Voice Lucy, English, speed -2, pitch 3
Dette er et eksempel på tekst - Rasmus, dansk
Rasmus, dansk, fart 5
This is example of voice Lucy, English en, speed 0
Voice Lucy, speed 5, pitch 3
Voice Lucy, speed 5, pitch 1
Voice Lucy, speed 5, pitch 2
Some incorrect voice tag, speed 5, pitch 2
#347: Set external sound for a part of the text using data-vfact-read attribute
Format #T
Format #T is used:
You should hear "Custom text", not "#T: Custom text". There is one more sentence here.
This is a sample text.
Format #T is used, custom text has two sentences:
You should hear "This is a first long sentences. This is the next long sentence". There is one more sentence here.
This is a sample text.
Format #T is used - text-to read is longer then visible text.
You should hear "This is long data vfact read text". There is one more sentence here.
Short.
Format #T: #T: is used:
You should hear "#T: Custom text", not "#T: #T: Custom text". There is one more sentence here.
This is a sample text.
Format #S
Format "#S: XXX" is used:
You should hear vfact-short-example.mp3. There is one more sentence here.
You shouldn't hear URL. You should hear content of "vfact-short-example.mp3"
Format "#S:xxx" is used:
You should hear vfact-short-example.mp3. There is one more sentence here.
You shouldn't hear URL. You should hear content of "vfact-short-example.mp3"
Format "#S:xxx" is used, three same blocks one by one - single sentence:
In total you should hear vfact-short-example.mp3 three times. There is one more sentence here.
Format "#S:xxx" is used, three same blocks one by one, hidden texts contain embedded blocks:
1 You shouldn't hear URL. You should hear content of "vfact-short-example.mp3"
2 You shouldn't hear URL. You should hear content of "vfact-short-example.mp3"
3 You shouldn't hear URL. You should hear content of "vfact-short-example.mp3"
I You shouldn't hear URL. B You should hear content of "vfact-short-example.mp3"
3 You shouldn't hear URL. You should hear content of "vfact-short-example.mp3"
Original text contains a lot of tags:
several short words, some of them are bold/word 1 bold word 2 + several short words/word 1 word 2
In total you should hear vfact-short-example.mp3 three times. There is one more sentence here.
Node with external sound has very complex content (with many nodes)
Next block is complex: two divs are wrapped by a div with data-vfact-read:
Next block has text nodes, nodes with children and comments
DIV You shouldn't hear URL.
DIV You should hear content of "vfact-short-example.mp3"
Text out of the div.
DIV You shouldn't hear URL.
Text out of the div.
subdiv: this is a first sentence of the complex text.
subdiv2: this is a second sentence of the complex text.
DIV You should hear content of "vfact-short-example.mp3". This is last sentences of the complex text.
DIV There is one more sentence here.
Multi-language: visible text has sentences on different languages
это текст на русском языке, достаточно длинный
I de fleste tilfælde kan vi ændre og forbedre på udtalen af ordene i talesyntesen.
>
You should hear: "This is first sentence. This is second sentence."
Broken external sound
Format "#S:missed sound" is used:
You should not hear this text and shouldn't hear URL.
The app should try to play sound file.. but the file doesn't exist.
Missed sound should be skipped, but next part should be played correctly.
If we have three parts: P1, P2, P3 and P2 has missed sound, users should hear P1, P3.
External audio has spaces in the name of folder and file
You should not hear this text and shouldn't hear URL.
#258: Set custom text using data-vfact-read attribute
Short and long sentences
Custom text is shorter then original:
You should hear "Custom text".
This is a sample text.
Custom text is longer then original:
You should hear "Long custom text".
Short sample.
Original text consists from several long sentences:
You should hear "Custom text to replace two sentences".
This is first long enough sentence. This is second sentence and it contains many words too.
Original text consists from several long sentences on different languages:
You should hear "Custom text to replace two sentences".
This is first English sentence. А это второе предложение на русском языке.
Custom text consists from several long sentences on different languages:
You should hear "Custom text 1. Пользовательский текст 2".
Text to replace.
Sub-nodes
Original text contains sub-tags:
You should hear "a half".
1/2
Original text contains sub-tags:
You should hear "one tenth".
10/100
Abbreviations
Original and custom texts contain known abbreviation "omg":
You should hear "text omg read".
Omg omg omg
Original and custom texts contain known abbreviation "forberedelsemateriellet":
You should hear "text omg read".
forberedelsemateriellet forberedelsemateriellet forberedelsemateriellet
Original and custom texts contain date "31.07.2020":
You should hear "text date read".
a 31.07.2020 b
Complex content
Original text contains a lot of tags:
You should hear "This is first sentence. This is second sentence.".
several short words, some of them are bold/word 1 bold word 2 + several short words/word 1 word 2
Incorrect - data-vfact-read contains another data-vfact-read:
It's hard to say what you should hear..
several short words, some of them are bold/word 1 bold word 2 + several short words/word 1 word 2
#360: Background sound
Background sound 1
Background sound 1 is played here.
There is no background sound here.
Lont text. Background sound 1 is played here. This is long text, background sound is comparatively small. But background
sound should be looped, so you should hear it during playing all parts of the text.
While the invention has been shown or described in only some of its forms, it should be apparent to those skilled in the art that it is not so limited, but is susceptible to various changes without departing from the scope of the invention. For example, steps can be performed in a different order to reach the same desired goal and heating can be affected in a variety of ways. Similarly, the process can be practiced as a batch or continuous-batch process without departing from the scope of the invention.
Background sound 2
Background sound 1 is played here.
There are no background sounds here.
Background sound 2 is played here.
Background sound 1 is played here.
Long text. Background sound 2 is played here. This is long text, background sound is comparatively small. But background
sound should be looped, so you should hear it during playing all parts of the text.
While the invention has been shown or described in only some of its forms, it should be apparent to those skilled in the art that it is not so limited, but is susceptible to various changes without departing from the scope of the invention. For example, steps can be performed in a different order to reach the same desired goal and heating can be affected in a variety of ways. Similarly, the process can be practiced as a batch or continuous-batch process without departing from the scope of the invention.
Background sound 2 is played here. This text consists from several parts.
Background sound is started to play for first part. It is stopped to play after finish of the last part.
Background sound shouldn't start to be played from the beginning on each text part.
Background sound and other data-vfact-commands
Pitch 1 + background sound is played here.
There are no background sounds here.
pitch 1
There are no background sounds or changes in the pitch here.
Pitch 1 + background sound is played here.
External sound + background sound.
There are no background sounds here.
background sound 1
There are no background sounds here.
external sound is played here
background sound 1
AAA + background sound is played here.
There are no background sounds here.
background sound 1
There are no background sounds here.
AAA + background sound (replaced by custom text)
Nested background sounds
Level 1. background sound 1.
Level 2. background sound 2.
Level 1. background sound 1.
Level 3. background sound 1.
Level 2. background sound 2.
AAA (replaced by "custom text", background 1 is still being played)
Level 3. background sound 1.
Pitch 1, background 1 is still being played.
Level 3. background sound 1.
Pitch 2, background 1 is still being played.
Pitch 3, background 1 is still being played.
Background sound - bad paths
Broken url
Not exist background sound is assigned here.
Data-vfact-read with background sound is included to another data-vfact-read with external sound:
External sound.
external sound + node with background sound
External sound.
Two background sounds in the same data-vfact-read
This is a sample sentence.
Real problems
Text only:
Text,Voice-s:
Text,Voice-speed:
Voice-speed,text: