Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>There is an error in the parenthesis in the first if-clause:</p> <pre><code>if (spokendata.substring(posCount).indexOf("[") == -1) { speechArr.push(meSpeak.speak (spokendata.substring(posCount)),{ 'rawdata': true }); /* ... */ } else { /* ... */ } </code></pre> <p>so it is</p> <pre><code> meSpeak( spokendata.substring(posCount) ), { 'rawdata': true } </code></pre> <p>where "{ 'rawdata': true }" is <em>not</em> included as an option-object to speak(). (In fact the object forms a separate statement separated by the comma.)</p> <p>So speak() returns "undefined", since it is not called to return any sound-data. As a consequence of this <em>undefined</em> is then used as an argument to play() (which fails, since there is no sound data for playback).</p> <p>What you want would be:</p> <pre><code> speechArr.push(meSpeak.speak (spokendata.substring(posCount), { 'rawdata': true })); </code></pre> <p>Other: Just updated meSpeak to v.1.8.3, which now logs any erroneous type forwarded to play(). Also there's now a small timing gap before cleaning up any sound-data to work around a timing issue with Chrome (sometimes Chrome is still playing when the reported duration of the sound is reached). Additionally, we 1) now clean-up the internal filesystem and 2) return a unique, newly produced array in case speak() is called to return an array. <a href="http://www.masswerk.at/mespeak" rel="nofollow">http://www.masswerk.at/mespeak</a></p> <p>On methods producing any special gaps directly in meSpeak:</p> <p>a) Most unlikely option first: You could try mark-up/HTML-input using the "ssml"-option. (Maybe any tags would produce a gap of any length).</p> <p>b) Probably the easiest option: You could use line-breaks ("\n") providing any length for the extra-gap with the "linebreaks" option (e.g. 'meSpeak.speak("this is a\n pause", { "linebreaks": 3})')</p> <p>c) Finally you could provide any phonemes producing a pause directly in the input string (as phoneme tags). The eSpeak documentation gives the following example for an input string including phonems: "[[D,Is Iz sVm f@n'EtIk t'Ekst 'InpUt]]" (See the very end of the page <a href="http://espeak.sourceforge.net/commands.html" rel="nofollow">http://espeak.sourceforge.net/commands.html</a>)</p> <p>On phonemes generally: "Phoneme mnemonics can be used directly in the text input to espeak. They are enclosed within double square brackets. Spaces are used to separate words, and all stressed syllables must be marked explicitly. eg: [[D,Is Iz sVm f@n'EtIk t'Ekst 'InpUt]]" (<a href="http://espeak.sourceforge.net/phonemes.html" rel="nofollow">http://espeak.sourceforge.net/phonemes.html</a>)</p> <p>The eSpeak documentation links to the following resource as a documentation of the phoneme-mnemonics: <a href="http://www.kirshenbaum.net/IPA/ascii-ipa.pdf" rel="nofollow">http://www.kirshenbaum.net/IPA/ascii-ipa.pdf</a></p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. COThe first if statement is only evaluated if there is no bracketed input into the method - Whilst this could cause an issue if the input was a single string of words, the input example clearly shows the [x] seperator - As I stated in the initial question, it works correctly except for the second string/word input into the method, can you explain why "Another" doesn't play? Even if I correct the parenthesis in the initial "if" statement, the second segment (after the "]") does not play.
      singulars
    2. CONot really. Please try version 1.8.3! (The previous code was analogous to speak.js, which used the array produced by the filesystem. In case this array would be returned to represent a stream to be cached, it might be overridden by the next call to speak(). This is now changed (we now use a newly generated array for any call). P.S.: I really would love to recompile eSpeak with emscripten (since meSpeak is based on quite dated code), but the last few SDKs fail to produce a working JS-code (resulting in "wav.wav" to be undefined). Did anyone succeed with this recently?
      singulars
    3. COBut please mind that each time play() failed, speak() returned 'undefined' (checked both in your code and logged in mespeak.js). I was able to catch this in the first if-clause. Also, I would recommend using some like 'meSpeak.speak("this is a\n pause", { "linebreaks": 3})' to have the gaps produced by meSpeak.
      singulars
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload