How to change audio-speed with ffplay:












1















if I have longer texts to read I like to have them read to me with the following script from https://wiki.ubuntuusers.de/Sprachausgabe/#SVOX-pico2wave .



1  #!/bin/bash    
2 pico2wave -l=de-DE -w=/tmp/test.wav "$(cat ${1})"
3 avplay -f wav -loglevel 0 >/dev/null -x 100 -y 50 -vn -autoexit /tmp/test.wav
4 rm /tmp/test.wav


Save the script as svox.sh in /usr/local/bin and start it with



svox.sh TEXTFILE.txt


That works really well with English texts (with "pico2wave -l=en-GB [...]" in line 2 of course) but the audio-speed in German is a bit slow.



What I´ve tried so far is replacing line 3 with



avplay -f wav -loglevel 0 >/dev/null -x 100 -y 50  -vn -autoexit -filter:a "atempo=2.0" /tmp/test.wav 


yet that didn´t work. In order to find out why that is I tried typing the following command in the terminal:



avplay -f wav -x 100 -y 50  -vn -autoexit -filter:a "atempo=2.0" test.wav


I got the following error-message:



[...]
Failed to set value 'atempo=2.0' for option 'filter:a': Option not found


So it seems that either the syntax isn´t correct or the option isn´t supported.
Does anyone know of a way to speed up the audio output?



P.S.:



my system: Linux/Lubuntu 16.04.5 LTS, 64 bit










share|improve this question





























    1















    if I have longer texts to read I like to have them read to me with the following script from https://wiki.ubuntuusers.de/Sprachausgabe/#SVOX-pico2wave .



    1  #!/bin/bash    
    2 pico2wave -l=de-DE -w=/tmp/test.wav "$(cat ${1})"
    3 avplay -f wav -loglevel 0 >/dev/null -x 100 -y 50 -vn -autoexit /tmp/test.wav
    4 rm /tmp/test.wav


    Save the script as svox.sh in /usr/local/bin and start it with



    svox.sh TEXTFILE.txt


    That works really well with English texts (with "pico2wave -l=en-GB [...]" in line 2 of course) but the audio-speed in German is a bit slow.



    What I´ve tried so far is replacing line 3 with



    avplay -f wav -loglevel 0 >/dev/null -x 100 -y 50  -vn -autoexit -filter:a "atempo=2.0" /tmp/test.wav 


    yet that didn´t work. In order to find out why that is I tried typing the following command in the terminal:



    avplay -f wav -x 100 -y 50  -vn -autoexit -filter:a "atempo=2.0" test.wav


    I got the following error-message:



    [...]
    Failed to set value 'atempo=2.0' for option 'filter:a': Option not found


    So it seems that either the syntax isn´t correct or the option isn´t supported.
    Does anyone know of a way to speed up the audio output?



    P.S.:



    my system: Linux/Lubuntu 16.04.5 LTS, 64 bit










    share|improve this question



























      1












      1








      1








      if I have longer texts to read I like to have them read to me with the following script from https://wiki.ubuntuusers.de/Sprachausgabe/#SVOX-pico2wave .



      1  #!/bin/bash    
      2 pico2wave -l=de-DE -w=/tmp/test.wav "$(cat ${1})"
      3 avplay -f wav -loglevel 0 >/dev/null -x 100 -y 50 -vn -autoexit /tmp/test.wav
      4 rm /tmp/test.wav


      Save the script as svox.sh in /usr/local/bin and start it with



      svox.sh TEXTFILE.txt


      That works really well with English texts (with "pico2wave -l=en-GB [...]" in line 2 of course) but the audio-speed in German is a bit slow.



      What I´ve tried so far is replacing line 3 with



      avplay -f wav -loglevel 0 >/dev/null -x 100 -y 50  -vn -autoexit -filter:a "atempo=2.0" /tmp/test.wav 


      yet that didn´t work. In order to find out why that is I tried typing the following command in the terminal:



      avplay -f wav -x 100 -y 50  -vn -autoexit -filter:a "atempo=2.0" test.wav


      I got the following error-message:



      [...]
      Failed to set value 'atempo=2.0' for option 'filter:a': Option not found


      So it seems that either the syntax isn´t correct or the option isn´t supported.
      Does anyone know of a way to speed up the audio output?



      P.S.:



      my system: Linux/Lubuntu 16.04.5 LTS, 64 bit










      share|improve this question
















      if I have longer texts to read I like to have them read to me with the following script from https://wiki.ubuntuusers.de/Sprachausgabe/#SVOX-pico2wave .



      1  #!/bin/bash    
      2 pico2wave -l=de-DE -w=/tmp/test.wav "$(cat ${1})"
      3 avplay -f wav -loglevel 0 >/dev/null -x 100 -y 50 -vn -autoexit /tmp/test.wav
      4 rm /tmp/test.wav


      Save the script as svox.sh in /usr/local/bin and start it with



      svox.sh TEXTFILE.txt


      That works really well with English texts (with "pico2wave -l=en-GB [...]" in line 2 of course) but the audio-speed in German is a bit slow.



      What I´ve tried so far is replacing line 3 with



      avplay -f wav -loglevel 0 >/dev/null -x 100 -y 50  -vn -autoexit -filter:a "atempo=2.0" /tmp/test.wav 


      yet that didn´t work. In order to find out why that is I tried typing the following command in the terminal:



      avplay -f wav -x 100 -y 50  -vn -autoexit -filter:a "atempo=2.0" test.wav


      I got the following error-message:



      [...]
      Failed to set value 'atempo=2.0' for option 'filter:a': Option not found


      So it seems that either the syntax isn´t correct or the option isn´t supported.
      Does anyone know of a way to speed up the audio output?



      P.S.:



      my system: Linux/Lubuntu 16.04.5 LTS, 64 bit







      sound lubuntu






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Jan 20 at 13:48







      Rosika

















      asked Jan 20 at 12:15









      RosikaRosika

      789




      789






















          2 Answers
          2






          active

          oldest

          votes


















          0














          in the meantime I managed to solve this problem with a workaround. I use this script:



          #!/bin/bash

          pico2wave -l=de-DE -w=/tmp/test.wav "$(cat ${1})"
          ffmpeg -i /tmp/test.wav -filter:a "atempo=1.2" -vn /tmp/test2.wav # increase speed by a factor of 1.2
          firejail --net=none avplay -f wav -loglevel 0 >/dev/null -x 100 -y 50 -vn -autoexit /tmp/test2.wav # play sound in a sandbox
          rm /tmp/test.wav
          rm /tmp/test2.wav





          share|improve this answer































            0














            If you are happy to use MPlayer rather than FFplay there is a relatively easy method to accomplish your goal. Use the following syntax:



            mplayer -af scaletempo -speed 0.5 my_file.mp4


            Remember to replace my_file.mp4 with the name of your actual media file. Now during playback you can use the following keys:



            {   <---This key will dynamically slow the playback speed
            } <---This key will dynamically increase playback speed


            Hopefully this will accomplish your goal.



            References:





            • Top 10 Tricks and Tips for the svn MPlayer My own page with this particular MPlayer trick and a handful of others.






            share|improve this answer
























            • Thanks a lot, Andrew. That´s exactly what I was looking for. I´m perfectly happy to use MPlayer and this command really does the trick. It´s really cool and I´m going to use in my script. Tnx also for your link. Seems like your homepage has a lot of interesting topics for me. Cheers.

              – Rosika
              Jan 22 at 13:24











            • @Rosika Great news :)

              – andrew.46
              Jan 22 at 20:39











            Your Answer








            StackExchange.ready(function() {
            var channelOptions = {
            tags: "".split(" "),
            id: "89"
            };
            initTagRenderer("".split(" "), "".split(" "), channelOptions);

            StackExchange.using("externalEditor", function() {
            // Have to fire editor after snippets, if snippets enabled
            if (StackExchange.settings.snippets.snippetsEnabled) {
            StackExchange.using("snippets", function() {
            createEditor();
            });
            }
            else {
            createEditor();
            }
            });

            function createEditor() {
            StackExchange.prepareEditor({
            heartbeatType: 'answer',
            autoActivateHeartbeat: false,
            convertImagesToLinks: true,
            noModals: true,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: 10,
            bindNavPrevention: true,
            postfix: "",
            imageUploader: {
            brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
            contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
            allowUrls: true
            },
            onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            });


            }
            });














            draft saved

            draft discarded


















            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1111349%2fhow-to-change-audio-speed-with-ffplay%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown

























            2 Answers
            2






            active

            oldest

            votes








            2 Answers
            2






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes









            0














            in the meantime I managed to solve this problem with a workaround. I use this script:



            #!/bin/bash

            pico2wave -l=de-DE -w=/tmp/test.wav "$(cat ${1})"
            ffmpeg -i /tmp/test.wav -filter:a "atempo=1.2" -vn /tmp/test2.wav # increase speed by a factor of 1.2
            firejail --net=none avplay -f wav -loglevel 0 >/dev/null -x 100 -y 50 -vn -autoexit /tmp/test2.wav # play sound in a sandbox
            rm /tmp/test.wav
            rm /tmp/test2.wav





            share|improve this answer




























              0














              in the meantime I managed to solve this problem with a workaround. I use this script:



              #!/bin/bash

              pico2wave -l=de-DE -w=/tmp/test.wav "$(cat ${1})"
              ffmpeg -i /tmp/test.wav -filter:a "atempo=1.2" -vn /tmp/test2.wav # increase speed by a factor of 1.2
              firejail --net=none avplay -f wav -loglevel 0 >/dev/null -x 100 -y 50 -vn -autoexit /tmp/test2.wav # play sound in a sandbox
              rm /tmp/test.wav
              rm /tmp/test2.wav





              share|improve this answer


























                0












                0








                0







                in the meantime I managed to solve this problem with a workaround. I use this script:



                #!/bin/bash

                pico2wave -l=de-DE -w=/tmp/test.wav "$(cat ${1})"
                ffmpeg -i /tmp/test.wav -filter:a "atempo=1.2" -vn /tmp/test2.wav # increase speed by a factor of 1.2
                firejail --net=none avplay -f wav -loglevel 0 >/dev/null -x 100 -y 50 -vn -autoexit /tmp/test2.wav # play sound in a sandbox
                rm /tmp/test.wav
                rm /tmp/test2.wav





                share|improve this answer













                in the meantime I managed to solve this problem with a workaround. I use this script:



                #!/bin/bash

                pico2wave -l=de-DE -w=/tmp/test.wav "$(cat ${1})"
                ffmpeg -i /tmp/test.wav -filter:a "atempo=1.2" -vn /tmp/test2.wav # increase speed by a factor of 1.2
                firejail --net=none avplay -f wav -loglevel 0 >/dev/null -x 100 -y 50 -vn -autoexit /tmp/test2.wav # play sound in a sandbox
                rm /tmp/test.wav
                rm /tmp/test2.wav






                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered Jan 21 at 12:44









                RosikaRosika

                789




                789

























                    0














                    If you are happy to use MPlayer rather than FFplay there is a relatively easy method to accomplish your goal. Use the following syntax:



                    mplayer -af scaletempo -speed 0.5 my_file.mp4


                    Remember to replace my_file.mp4 with the name of your actual media file. Now during playback you can use the following keys:



                    {   <---This key will dynamically slow the playback speed
                    } <---This key will dynamically increase playback speed


                    Hopefully this will accomplish your goal.



                    References:





                    • Top 10 Tricks and Tips for the svn MPlayer My own page with this particular MPlayer trick and a handful of others.






                    share|improve this answer
























                    • Thanks a lot, Andrew. That´s exactly what I was looking for. I´m perfectly happy to use MPlayer and this command really does the trick. It´s really cool and I´m going to use in my script. Tnx also for your link. Seems like your homepage has a lot of interesting topics for me. Cheers.

                      – Rosika
                      Jan 22 at 13:24











                    • @Rosika Great news :)

                      – andrew.46
                      Jan 22 at 20:39
















                    0














                    If you are happy to use MPlayer rather than FFplay there is a relatively easy method to accomplish your goal. Use the following syntax:



                    mplayer -af scaletempo -speed 0.5 my_file.mp4


                    Remember to replace my_file.mp4 with the name of your actual media file. Now during playback you can use the following keys:



                    {   <---This key will dynamically slow the playback speed
                    } <---This key will dynamically increase playback speed


                    Hopefully this will accomplish your goal.



                    References:





                    • Top 10 Tricks and Tips for the svn MPlayer My own page with this particular MPlayer trick and a handful of others.






                    share|improve this answer
























                    • Thanks a lot, Andrew. That´s exactly what I was looking for. I´m perfectly happy to use MPlayer and this command really does the trick. It´s really cool and I´m going to use in my script. Tnx also for your link. Seems like your homepage has a lot of interesting topics for me. Cheers.

                      – Rosika
                      Jan 22 at 13:24











                    • @Rosika Great news :)

                      – andrew.46
                      Jan 22 at 20:39














                    0












                    0








                    0







                    If you are happy to use MPlayer rather than FFplay there is a relatively easy method to accomplish your goal. Use the following syntax:



                    mplayer -af scaletempo -speed 0.5 my_file.mp4


                    Remember to replace my_file.mp4 with the name of your actual media file. Now during playback you can use the following keys:



                    {   <---This key will dynamically slow the playback speed
                    } <---This key will dynamically increase playback speed


                    Hopefully this will accomplish your goal.



                    References:





                    • Top 10 Tricks and Tips for the svn MPlayer My own page with this particular MPlayer trick and a handful of others.






                    share|improve this answer













                    If you are happy to use MPlayer rather than FFplay there is a relatively easy method to accomplish your goal. Use the following syntax:



                    mplayer -af scaletempo -speed 0.5 my_file.mp4


                    Remember to replace my_file.mp4 with the name of your actual media file. Now during playback you can use the following keys:



                    {   <---This key will dynamically slow the playback speed
                    } <---This key will dynamically increase playback speed


                    Hopefully this will accomplish your goal.



                    References:





                    • Top 10 Tricks and Tips for the svn MPlayer My own page with this particular MPlayer trick and a handful of others.







                    share|improve this answer












                    share|improve this answer



                    share|improve this answer










                    answered Jan 22 at 5:57









                    andrew.46andrew.46

                    21.7k1469149




                    21.7k1469149













                    • Thanks a lot, Andrew. That´s exactly what I was looking for. I´m perfectly happy to use MPlayer and this command really does the trick. It´s really cool and I´m going to use in my script. Tnx also for your link. Seems like your homepage has a lot of interesting topics for me. Cheers.

                      – Rosika
                      Jan 22 at 13:24











                    • @Rosika Great news :)

                      – andrew.46
                      Jan 22 at 20:39



















                    • Thanks a lot, Andrew. That´s exactly what I was looking for. I´m perfectly happy to use MPlayer and this command really does the trick. It´s really cool and I´m going to use in my script. Tnx also for your link. Seems like your homepage has a lot of interesting topics for me. Cheers.

                      – Rosika
                      Jan 22 at 13:24











                    • @Rosika Great news :)

                      – andrew.46
                      Jan 22 at 20:39

















                    Thanks a lot, Andrew. That´s exactly what I was looking for. I´m perfectly happy to use MPlayer and this command really does the trick. It´s really cool and I´m going to use in my script. Tnx also for your link. Seems like your homepage has a lot of interesting topics for me. Cheers.

                    – Rosika
                    Jan 22 at 13:24





                    Thanks a lot, Andrew. That´s exactly what I was looking for. I´m perfectly happy to use MPlayer and this command really does the trick. It´s really cool and I´m going to use in my script. Tnx also for your link. Seems like your homepage has a lot of interesting topics for me. Cheers.

                    – Rosika
                    Jan 22 at 13:24













                    @Rosika Great news :)

                    – andrew.46
                    Jan 22 at 20:39





                    @Rosika Great news :)

                    – andrew.46
                    Jan 22 at 20:39


















                    draft saved

                    draft discarded




















































                    Thanks for contributing an answer to Ask Ubuntu!


                    • Please be sure to answer the question. Provide details and share your research!

                    But avoid



                    • Asking for help, clarification, or responding to other answers.

                    • Making statements based on opinion; back them up with references or personal experience.


                    To learn more, see our tips on writing great answers.




                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function () {
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1111349%2fhow-to-change-audio-speed-with-ffplay%23new-answer', 'question_page');
                    }
                    );

                    Post as a guest















                    Required, but never shown





















































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown

































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown







                    Popular posts from this blog

                    Questions related to Moebius Transform of Characteristic Function of the Primes

                    List of scandals in India

                    Can not write log (Is /dev/pts mounted?) - openpty in Ubuntu-on-Windows?