• officeproductsinternational

    (@officeproductsinternational)


    Hi,

    The plugin is not generating an audio file. For now it’s set to save the mp3 locally (and same settings work on another WP wesbite), tried using S3, created a bucket for it, but nothing gets into the bucket as well.
    When using Wp debug, there doesn’t seem to be any error: [26-Apr-2021 13:35:24 UTC] AmazonAI_PollyService::save_post Saving post ( id=887009 )
    [26-Apr-2021 13:35:24 UTC] AmazonAI_PollyService::save_post Starting background task process ( id=887009 )
    [26-Apr-2021 13:35:24 UTC] AmazonAI_BackgroundTask::trigger Triggering background task generate_post_audio
    and this is where it stops.
    I tried specifying particular post types (“news posts”), tried disabling plugins, it doesn’t seem to work.
    Running AWS Version 4.3.1 on Wp 5.7.1.
    Could you please help?
    Many thanks,
    Aurora

    The page I need help with: [log in to see the link]

Viewing 12 replies - 1 through 12 (of 12 total)
  • Plugin Author troylar

    (@troylar)

    Can you provide additional details?

    Which voice are you using?

    Neural or standard?

    Which language?

    Can you share your permissions for the role?

    Thread Starter officeproductsinternational

    (@officeproductsinternational)

    Thanks for getting back so quickly!
    Standard voice, US English Matthew, no Neural voice activated, AWS Region US East (N Virginia) – that’s just because I found these to work on another website we have. Source language English.
    Sorry, I don’t understand what you mean by permissions for the role, I am more than happy to add you as an admin if that is what you are saying? Sorry if I didn’t understand this one.
    Really appreciate your quick answer!
    Aurora

    Plugin Author troylar

    (@troylar)

    Can you send the AWS user role policy?

    Hi, since this seams related I will post here:

    I seem to have the same (or a similar) problem. I’m able to connect but it just doesn’t generate the audio file.

    AWS policy: AWSForWordPressPluginPolicy
    Language: German
    German – Vicky
    Standard

    Thread Starter officeproductsinternational

    (@officeproductsinternational)

    AWS policy: AWSForWordPressPluginPolicy.

    I used the same user (access key ID & secret access key) on the other website as a test and that one was working.

    Plugin Author troylar

    (@troylar)

    Is it the same version of the plugin on the other site?

    I’m using the newest version 4.3.1

    My log files show the following, when saving a post:

    [27-Apr-2021 06:13:26 UTC] AmazonAI_PollyService::save_post Saving post ( id=6880 )
    [27-Apr-2021 06:13:27 UTC] AmazonAI_PollyService::save_post Starting background task process ( id=6880 )
    [27-Apr-2021 06:13:27 UTC] AmazonAI_BackgroundTask::trigger Triggering background task generate_post_audio

    No audio file is generated/saved ??

    Thread Starter officeproductsinternational

    (@officeproductsinternational)

    Hi, yes, the other website has the same version of plugin and works perfectly.

    Does the plugin need any specific privileges to write data?

    While all other plugins are able to do that, I’m not sure, maybe your plugin does need another configuration or specific privileges?

    @troylar: If this is the case, could you please share this information? Thanks!

    • This reply was modified 3 years, 7 months ago by jbnetat.
    Thread Starter officeproductsinternational

    (@officeproductsinternational)

    On the website I thought the plugin was working I just discovered the ‘Download’ button doesn’t work.
    So I tried locating where the mp3 files are saved – I read on this forum that they should be visible in the Media Library, they are not and won’t show up searching for them in WP backend. They are randomly saved in “wp-content/uploads/” in folders from various years: 2019, 2018 not the date when they were created and even though the play button plays the mp3, the download button (which doesn’t show up on Mozilla at all) gets the wrong link: /amazon_polly_2555.mp3?version=1619174962
    Not concerned about the button right now, just hoping this helps in any way understanding how randomly the mp3 gets generated (when it gets).

    @jbnetat in your log file, do you also have:

    [29-Apr-2021 12:06:05 UTC] AmazonAI_PollyService::save_post Starting background task process ( id=886711 )
    [29-Apr-2021 12:06:05 UTC] AmazonAI_BackgroundTask::trigger Triggering background task generate_post_audio
    [29-Apr-2021 12:13:43 UTC] AmazonAI_PollyService::save_post Saving post ( id=886677 )
    [29-Apr-2021 12:15:20 UTC] AmazonAI_PollyService::save_post Saving post ( id=887068 )

    the last two ID-s ( 886677,88068 ) don’t stand for any published post, there is no post for the two IDson the website.

    Still having the problem, can’t find a solution ??

    @troylar: Any idea how you could help me? Thanks!

    I had the same issue, but I discovered something interesting that can point in the right direction. What I discovered is that for some reason, the call to the function $background_task->trigger … is not working.
    But if instead we do a direct call to the method generate_audio( $post_id )
    then the audio is generated in the S3 bucket, and then I can reproduce the audio in the player, and everything seems to work as expected.

    So here is the file I edited:

    wp-content/plugins/amazon-polly/admin/AmazonAI-PollyService.php

    at the bottom of this function:
    public function save_post( $post_id, $post, $updated ) {

    You will find following lines of code:

    if( ! ( wp_is_post_revision( $post_id) || wp_is_post_autosave( $post_id ) ) ) {
                $logger->log(sprintf('%s Starting background task process ( id=%s )', __METHOD__, $post_id));
                $background_task = new AmazonAI_BackgroundTask();
                $background_task->trigger(self::GENERATE_POST_AUDIO_TASK, [ $post_id ]);
                // *** Added this extra line here ***
                $this->generate_audio( $post_id ) ;
            }

    I added that extra line at the end:

    $this->generate_audio( $post_id ) ;

    This is just calling directly a function that is located below in the same class.
    Somehow that forces the audio to be generated on S3 bucket, and I can reproduce the audio in the player as expected.
    Now, I will not claim that this is a correct fix, but it should point in the right direction, and it is working fine for me.

Viewing 12 replies - 1 through 12 (of 12 total)
  • The topic ‘Audio file not generating’ is closed to new replies.