• Hi I am trying to convert audio on the front end using my custom post form. How can I go about this?

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Contributor tstachlewski

    (@tstachlewski)

    Hi @kased,
    Could you elaborate a bit please?

    Cheers,
    Tomasz

    Thread Starter kased

    (@kased)

    Ok, no problem.

    On a frontend page template I have a form for creating posts, and to do so I have the following code (snippets from my full code) –

    if (get_query_var('site')) {
    $v_Id = get_query_var('site');
    $v_title = get_the_title($v_Id);
    $voice_id = get_post_meta($v_Id, 'amazon_polly_voice_id');
    $sample_rate = get_post_meta($v_Id, 'amazon_polly_sample_rate');
    $amazon_polly_settings_hash = get_post_meta($v_Id, 'amazon_polly_settings_hash');
    $post_content = get_post_meta($v_Id, 'content', true);
    ------------
    .....$voice_id = $_POST['amazon_polly_voice_id'];
    $sample_rate = $_POST['amazon_polly_sample_rate']; .... etc.
    -------------
    ....  $post = array(
                        'ID' => get_query_var('site'),
                        'post_title' => $v_title,
                        'post_content' => $post_content,
                        'post_status' => 'draft',
                        'post_type' => 'v_editor'  // Use a custom post type if you want to
                    );
                    $pid = wp_insert_post($post); ....
    --------
    // form fields etc.

    I want users to be able to enter text in the form content field and have the audio file created and saved to a custom folder.

    I have no problem creating posts, and on the post page I see the audio player is showing, but there’s no audio being created.

    On the back end it works as should, so what am I missing for the file to be created on form submission on the front end?

    thanks

    Plugin Contributor tstachlewski

    (@tstachlewski)

    Oh, so you would like to reuse the logic which is inside the plugin for your custom form for creating posts, yes?… We have never tested something like this to be honest, and the plugin was not prepared for it :/ I’m afraid I won’t be able to help a lot here @kased ??

    Thread Starter kased

    (@kased)

    Ok thanks. I came across this page — https://w3lessons.info/2018/02/07/php-text-to-speech-amazon-polly/ so I will try it out.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Use on front end post form’ is closed to new replies.