Code

Discussion on Speaker – Page to Speech Plugin for WordPress

Discussion on Speaker – Page to Speech Plugin for WordPress

Cart 969 sales
Recently Updated

merkulove supports this item

Supported

This author's response time can be up to 2 business days.

305 comments found.

there was no problem with previous version. Is it possible to download one somewhere to try?

Can you provide us specific phrases or words via help@merkulov.design that sound correct on a Google test but not in the plugin? We will test them and see how we can fix this.

done :) thanks you

Hello,

I switched to neural voice and I can’t generate voices anymore. I have this error message:

"message": "Request contains an invalid argument.",
   "status": "INVALID_ARGUMENT",

I tried to change many parameters but nothing works. Could you please help me?

Hello! Indeed there may be problems using the Neural French voice in certain conditions(maybe when using some symbols or characters) and we can’t say more specifically about the reasons. It happens even when testing a certain text on the Google demo https://cloud.google.com/text-to-speech#section-2 Since these Neural voices were added recently, there may still be some problems with them on Google side. You can report the bugs with your text example via https://cloud.google.com/support/docs/community-support

I have spent many days working around the limitations of Google TTS in vocalising French. The main problem (besides some incorrect pronunciations) was the treatment of slurs, often far from (academic) usage. To achieve it, I introduced a large number of rules. French speakers can listen to an example on my page https://lebonheurestpossible.org/vitamine-d/ and read its conversion trace: https://lebonheurestpossible.org/wp-content/uploads/speaker/post-453.txt (to be viewed in UTF8).

However, this required solving two problems: (1) the correct handling of Unicode and (2) soft hyphens. Here are the explanations:

1) I had to modify a line (circa 1950) in SpeakerCaster.php by replacing

$post_content = preg_replace( $expressions[ $i - 1 ], $exp, $post_content );

with:

$post_content = preg_replace( $expressions[ $i - 1 ]."u", $exp, $post_content );

The trick is the “u” option forcing preg_replace() to read the source and target as UTF8.

2) Soft hyphens (https://wikimass.com/html/entities/soft-hyphen) are obviously of no use for interpreting French. Google does perfectly well with (French) texts that are not pre-segmented. On the other hand, the “shy” code inside a word prevents its recognition in a regular expression. It is therefore necessary to eliminate these soft hyphens, and to do this, introduce the simple rule:

/\x{00AD}/

(Second line must be empty!)

Note that I could do all of this owing to the tracing which I had implemented: three simple patches in SpeakerCaster.php version 3.4.3. See point 1 of the note I sent to the technical team: https://lebonheurestpossible.org/wp-content/uploads/notes.txt

I will follow updates of this plugin once the tracing mechanism has been integrated. :-)

Hello, thanks for tirelessly providing details to improve the Speaker. The points 3(SOFT HYPHENS) and 9(LANGUAGE-SPECIFIC REPLACEMENT PATTERNS) will be added in the next version of the plugin. The points 6 and 10 will be added in future updates. The points 2,4,7 cannot be reproduced or fixed for technical reasons. The point 1,5,8 will be considered in the futere.

Excellent news!

Point 1 could be fixed very quickly if you look at patches on the file I sent you… And it is essential for designers of replacement patterns. ;-)

Thanks but the solution with text files is not acceptable to us, so we will use another way.

Amazing plugin. Full-featured … and it works!

I know I can add pre-roll and post-roll “audio ads” using the “Before Audio” and “After Audio” fields. But do you know of a way to programmatically add pre-roll/post-roll/mid-roll advertisements within the MP3s that Google generates?

Hello! There is a way to add pre-roll/post-roll/mid-roll features but with some restrictions. This can be considered as a custom service. Please contact us via help@merkulov.design for details If you are interested.

There is a bug which I quickly fixed in SpeakerCaster.php:

If the title of an article or page contains a sequence of caps, for instance “Lecture automatique (TTS)”, it is likely to be tagged as follows:

Lecture automatique (<span class="caps">TTS</span>)

The result is that the content or “aria-label” contains these tags, including their quotes which mess up the code and results in a wrong display of the player.

This is very easy to fix: in 3 places of SpeakerCaster.php, replace variable ”$title” with:

preg_replace("/<\/?[^>]*?>/u",'',$title)

Can you tell me the URL of your test page?

My test page for this was:

Lecture automatique (TTS)

https://lebonheurestpossible.org/tts-fr/

It works because I patched SpeakerCaster.php with these calls of preg_replace():

preg_replace("/<\/?[^>]*?>/u",'',$title)

You can see in my page’s code (line 3467) that “TTS” is wrapped in “span class=’caps’” tags. Just below (line 3480) you can see:

aria-label=”Audio of Lecture automatique (TTS)”

which means that the “span” tags have been removed, failing to which there would be a mess with quote signs.

It might take ages to figure out which other 3d-party plugins/themes create or fix this problem. I strongly recommend to fix it at the level of Speaker to prevent such (and similar) cases from happening, as it would make your clients feel very confused. To fix it, you only need to replace ”$title” with exactly the preg_replace call which I reproduced above. This took me less than 2 minutes to patch SpeakerCaster.php…

Incidently, this morning my page “Lecture automatique (TTS)” was no longer displaying any player (by Speaker, by Meks, nor default). After a long enquiry I found out this was due to having set “Enable the caching mechanisms” in plugin “CM Table Of Contents Pro”. I don’t have an explanation for this. Anyway, it’s not Speaker’s fault since the display failed for alternate audio players. :-)

To make things clear, in SpeakerCaster.php you need to replace line 89:

return str_replace( '<audio ', '<audio aria-label="' . esc_html__( 'Audio of', 'speaker' ) . ' ' .  $title . '"', $html );

with:

return str_replace( '<audio ', '<audio aria-label="' . esc_html__( 'Audio of', 'speaker' ) . ' ' .  preg_replace("/<\/?[^>]*?>/u",'',$title) . '"', $html );

and do the same in two more similar occurrences of $title.

Solved! Thank you for paying attention to this issue.

Hello! It seems that there is a bug in the design of the player.

On my site, it is partly hidden by the text of short posts (such as https://lebonheurestpossible.org/travaux-recents-sur-le-sommeil/) whereas it looks fine on longer ones such as https://lebonheurestpossible.org/une-education-du-sommeil/.

The bug is an unwanted extra

 in the code reproduced below. It is there whatever design has been choosen.

The code:

<pre><div class="desktop">
<div class="mdp-speaker-wrapper">
<div class="mdp-speaker-box shortcode  speaker-chrome">

<div data-download="1">
<audio aria-label="Audio of Travaux récents sur le sommeil" class="wp-audio-shortcode" id="audio-2211-2" preload="metadata" style="width: 100%;" controls="controls"><source type="audio/mpeg" src="https://lebonheurestpossible.org/wp-content/uploads/speaker/post-2211.mp3?cb=1673623192.mp3&_=2"><a href="https://lebonheurestpossible.org/wp-content/uploads/speaker/post-2211.mp3?cb=1673623192.mp3">https://​lebon​heu​rest​pos​sible​.org/​w​p​-​c​o​n​t​e​n​t​/​u​p​l​o​a​d​s​/​s​p​e​a​k​e​r​/​p​o​s​t​-​2​2​1​1​.​m​p​3​?​c​b​=​1​6​7​3​6​2​3​1​9​2​.​mp3</a></audio>
</div>

UNWANTED ====>>> </div>

<div class="mdp-speaker--speed speaker-chrome">

<div class="mdp-speaker--speed-title">
<p>Vitesse de lecture :</p>
</div>

<div class="mdp-speaker--speed-box">
<button class="mdp-speaker--speed-button" aria-label="0.75x speed" title="0.75x speed" data-speed="0.75">0.75x</button>
<button class="mdp-speaker--speed-button" aria-label="1x speed" title="1x speed" data-speed="1">1x</button>
<button class="mdp-speaker--speed-button" aria-label="1.25x speed" title="1.25x speed" data-speed="1.25">1.25x</button>
<button class="mdp-speaker--speed-button" aria-label="1.5x speed" title="1.5x speed" data-speed="1.5">1.5x</button>
</div>

</div>
<p></p><p></p>
</div>
</div>/<pre /></pre>

Sorry for the disruption !

The solution I suggested above only worked in a few particular cases… I finally figured out why the display of this player is not correct on short pages/posts: the culprit is wp-Typography, an excellent typography plugin which modifies the shapes of quotes and inserts non-breaking spaces etc. in compliance with language-specific typographic rules. This plugin is almost indispensable when publishing in French…

The solution is to go to the general settings of wp-Typography and add “mdp-speaker-wrapper” to the list of classes that should be excluded from its modifications.

The solved most of my problems, except the incorrect display of the player at the bottom of post : https://lebonheurestpossible.org/des-glaces-pleines-de-vide/

Hello! I’m glad you were able to figure out the issue. As for the incorrect display of the player, it looks like some third party plugin adds the styles https://take.ms/XLDbU for the Speaker using a script since this is not our CSS.

Yes! Probably a bad trick played by our (obsolete) “Times” theme, as it only affects short texts. Fortunately, I now implemented Meks Audio Player as a work-around, until you supply a floating/sticky variant of the player… Meks is ugly but efficient. ;-)

Hello! If you convert “30 – 20 = 10” in English, it says correctly “thirty minus twenty equals 10”. But if you do the same in French it says “trente m-i-n-u-s vingt égale 10”. This means that the French TTS does not recognize the “–” glyph which is then converted to non-basic ASCII coded “U+2013.” May be simply send ’-’ to Google? I guess the issue lies with Google, not SPEAKER, although it might point to a bug in the plugin. I found very few mistakes in French TTS which I was able to bypass using regex rules… This plugin is amazing!!!

Hello! Thanks for your attention to detail, we noted it and will follow it. I don’t think there can be any universal solution as the ”-” can be used in different cases. We’ve tested this on Google voice synthesis services and there is such a problem as well.

This confirms my guess that this problem belongs to Google.

Hi there. Did you created plugin (you mentioned that in this comment section) that supports Microsoft integration of text-to-speech? Since I see only Google is supported, but Google doesn’t offer my language.

Hello! We do not plan to include Microsoft support for the Speaker. A new plugin based on Microsoft will be created in the near future.

Hi there, I purchased this few days ago and activated it today. but I couldn’t find ‘Post Types’ menu on the admin panel. Also there wasn’t icons for managing speech templates on the speaker block(right sidebar). Is there anything I have to do more?

Hello! The Speaker Utilities plugin should be installed automatically after the Speaker activation via your purchase code. Once the Speaker Utilities is activated the full functionality of the plugin including post type, bulk generation, and custom templates will be available. If the problem still exists, please contact us via help@merkulov.design and provide your site access details to look at the issue.

I sent email. please, check it. Thanks

Got it and replied

this is a problem : https://ibb.co/Nn2Jtqq

The voice seem to be different

Hello! Thanks for letting us know. For some reason, we get several languages with the same name from Google. It will be fixed in the next plugin release.

Hello! I am trying to use CSS so that the player will be displayed at different locations on desktop and smartphones. On smartphones I want it to appear on top of the page, as suggested by dailythemes (24 days ago). So, for instance I created an id named “desktop” that makes elements invisible on smartphones. It works fine with a line such as:

This text is not visible on a smartphone

But is doesn’t work with:

[speaker]

The speaker remains visible… How can I get around this?

Sorry, code disappeared on my comment! I had written [speaker] inside paragraphs tagged with id=”desktop”…

I made it work! The trick is to wrap [speaker] between div and /div tags, where div has class “desktop”. You can check this looking at the source code of https://lebonheurestpossible.org/soigner-ses-arteres/ and display this page on both desktop annd mobile units. By the way, the French accent of this voice is excellent! :-)

I’m glad you were able to manage it.

I have just upgraded from 3.4.1 to 3.4.2, and reactivated successfully. Apparently, SSML codes (such as voice change) are no longer executed. Besides, there is no (more?) a file such as wp-content/plugins/speaker/SpeakerUtilities.php

Besides, in the previous versions I had noticed a “Speaker Utilities” plugin among Wordpress extensions, but after upgrading it disappeared. This might be part of the explanation…

I got around this problem replacing

with

<voice name=”fr-FR-Neural2-C”>

as suggested by Raydianze (8 days ago)…

I think there is a lack of documentation about supported/unsupported SSML codes. I haven’t yet tried the ones controling prosody, pauses etc.

Hello! The problem with the “Speaker Utilities” removal may occur when the plugin is manually updated (via FTP). That is, it is better to update the plugin through the admin panel. In any case, we will consider the causes of such a problem. https://docs.merkulov.design/speech-synthesis-markup-language-ssml-in-the-speaker-wordpress-plugin/

For now, please contact us via help@merkulov.design and we will provide you with the missing “Speaker Utilities” file so you can add it to the plugin and get all the Speaker functionality including support for all the listed shortcodes https://docs.merkulov.design/speech-synthesis-markup-language-ssml-in-the-speaker-wordpress-plugin/

speaker-sub, speaker-emphasis // these are NOT working correctly! As per your documentation. HELP!

Everything is correctly activated and registered… I do not have a public facing staging site because I develop everything on localhost. Take a look at Shortcodes.php … it is dated 08/12/2021 … It does NOT contain those shortcodes as per your documentation! I am using the 3.4.1 version

I have been able to use these codes to get around the issue for now… https://cloud.google.com/text-to-speech/docs/ssml#voice

Not all shortcodes are in the Shortcodes.php file. For example [speaker-voice name=”en-GB-Wavenet-C”] is in the wp-content/plugins/speaker/SpeakerUtilities.php in line 250. So, If the plugin is activated https://take.ms/lqxrF , then the shortcodes work correctly. We’ve checked and everything works correctly on our side.

I’m sorry, but there are always problems and it’s an incredible waste of time. You want to provide paid support even for very simple functional errors? The following are purely plugin errors.

1- When I choose one of the rounded types, only the blue part of the player comes and the play etc parts are not… 2- I can’t change the background color of the player (wordpress player) in any way 3- I can’t turn off the audio download part 4- my sound settings are not reflected

do you really have a solution? I don’t have any more time!

1. The problem with the player display may be due to disabled media elements in the theme https://stackoverflow.com/questions/25436646/media-element-js-and-wordpress-usage. To answer more precisely, we need to look at the problem on your site. For this, switch the player to blue and provide your direct page link.

2. By choosing the WordPress or browser default player, you thereby refuse any customization and use the Default one. In this case, the color settings are not displayed.

3,4. Make sure all caching plugins and settings are disabled when configuring plugins. It would be better to use it after finishing all setting up work.

I add a player with a shortcode on a loop, archive or a page with multiple posts. But the serious problem is that while one sound is playing, the previous one does not automatically stop when another sound starts. Voices overlap. This single page is valid both in the topic and in related posts. I might want to use the shortcode, that is the player.

What solution does it have? Thank you.

We have already mailed you.

Thanks. I replied.

I would like to ask a few questions before buying.

1- Can we add a button to the post loop and single page with a shortcode or a similar method? 2- Can we store the recorded sounds on our own server? I guess after the first listen the sound is recorded and on the next request the mp3 file on our own server is played? Google api is not needed again in the 2nd request?

Hello! 1. Please specify which button do you mean. If you mean an audio player you can add the player for a specific post using the shortcode https://docs.merkulov.design/speaker-wordpress-plugin-settings-2/#design

2. Audio files are saved in the Media Library or Media library + Google Drive https://take.ms/1mfDx. Each time you Create or Re-create audio for your posts, a certain number of characters are subtracted from your quota. The characters are only counted during audio generation and it does not matter how many times users/visitors listen to the generated audio.

I want to make a specially designed stop/play button, not a player. And I want to put it inside the post loops in the sample archive file. Thus, this button will appear and run automatically at the top of each article. Please check the image for sample code.

https://freeimage.host/i/HnCfAT7

For now, you can only display the player (not the button) using the speaker shortcode in your loop. After that, the player can be customized with css and js to get a play button. We can offer this feature as a custom service. If you are interested, you can contact us via help@merkulov.design for details.

Hi, will these plugin work with discy theme? In the questions and in the answers, and in swedish? https://www.vadkostar.se/Fragor/vad-kostar-det-att-bygga-pool/

Hello! The WordPress universe has a lot of themes and plugins created by different authors. We cannot check our product for compatibility with each plugin or theme. However, you can be sure that our plugins crafted following all rules and standards of WordPress development. And they should not cause any compatibility problems with other plugins and themes made according to WordPress standards.

does this work for custom post type?

Hello! Yes, it supports custom post type.

is it support hebrew ?

Hello! All available languages and voices are here https://cloud.google.com/text-to-speech/docs/voices

rphrus2 Purchased

very frustrated with this plugin keep say plugin not activated, tried to activate and working again, then it says not activated which happen randomly, fix again, then problem again and everytime I deactivate I will lose the settings and previous audio not working, keep trying again and again. I am giving up on this plugin.

Hello! Please make sure you use the latest plugin version(3.4.1). If the problem persists, please contact us via help@merkulov.design and provide your site access details to consider the issue more detail.

by
by
by
by
by
by

Tell us what you think!

We'd like to ask you a few questions to help improve CodeCanyon.

Sure, take me to the survey