Skip to content

Instantly share code, notes, and snippets.

@sourceperl
Last active February 18, 2021 14:45

Revisions

  1. sourceperl revised this gist Feb 18, 2021. 3 changed files with 28 additions and 0 deletions.
    9 changes: 9 additions & 0 deletions say_cpu_temp.py
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,9 @@
    #!/usr/bin/env python3

    import os, time

    while True:
    with open('/sys/class/thermal/thermal_zone0/temp', 'r') as f:
    cpu_temp = round(float(f.read()) / 1000)
    os.system('espeak -v mb-fr1 -s 95 \'La température de la CPU est de %s degrés.\'' % cpu_temp)
    time.sleep(2.0)
    2 changes: 2 additions & 0 deletions setup_rpi2_jessie.sh
    Original file line number Diff line number Diff line change
    @@ -1,3 +1,5 @@
    # setup script for Raspberry Pi2 (Raspbian/jessie)

    # install espeak
    sudo apt-get install espeak

    17 changes: 17 additions & 0 deletions setup_rpi4_buster.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,17 @@
    # setup script for Raspberry Pi4 (Raspbian/buster)

    # install espeak (will be replace by espeak-ng see https://github.com/espeak-ng/espeak-ng)
    sudo apt-get install espeak

    # install mbrola (binaries of debian "non-free" category are not available on Raspbian/buster)
    wget http://ftp.fr.debian.org/debian/pool/contrib/m/mbrola/mbrola_3.3+dfsg-4~bpo10+1_armhf.deb
    sudo dpkg -i mbrola_3.3+dfsg-4~bpo10+1_armhf.deb
    rm mbrola_3.3+dfsg-4~bpo10+1_armhf.deb

    # install voices for mbrola ("non-free" but as it's not binaries packages we can install it)
    sudo apt-get install mbrola-fr1 mbrola-fr2

    # test it !
    espeak -s 95 -v mb/mb-fr1 'installation terminé. On peux maintenant utiliser espeak !'

    # see say_cpu_temp.py sample script for an example of use with python3
  2. sourceperl revised this gist Feb 18, 2021. No changes.
  3. sourceperl renamed this gist Feb 18, 2021. 1 changed file with 0 additions and 0 deletions.
    File renamed without changes.
  4. sourceperl revised this gist Jun 9, 2016. 1 changed file with 15 additions and 1 deletion.
    16 changes: 15 additions & 1 deletion setup.sh
    Original file line number Diff line number Diff line change
    @@ -14,4 +14,18 @@ sudo mkdir -p /usr/share/mbrola/voices/
    sudo cp -r /opt/mbrola/fr1/* /usr/share/mbrola/voices/

    # test it !
    espeak -s 125 -v mb/mb-fr1 'installation terminé. On peux maintenant utiliser espeak !'
    espeak -s 125 -v mb/mb-fr1 'installation terminé. On peux maintenant utiliser espeak !'

    # sample script for use with python

    # #!/usr/bin/env python
    # # -*- coding: utf-8 -*-
    #
    # import os, time
    #
    # var1 = 0
    #
    # while True:
    # os.system('espeak -v mb-fr1 -s 120 \'variable var1 égale à %s\'' % var1)
    # var1 += 1
    # time.sleep(1.0)
  5. sourceperl revised this gist Jun 9, 2016. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion setup.sh
    Original file line number Diff line number Diff line change
    @@ -14,4 +14,4 @@ sudo mkdir -p /usr/share/mbrola/voices/
    sudo cp -r /opt/mbrola/fr1/* /usr/share/mbrola/voices/

    # test it !
    espeak -x -q -v mb/mb-fr1 'installation terminé. On peux maintenant utiliser espeak !'
    espeak -s 125 -v mb/mb-fr1 'installation terminé. On peux maintenant utiliser espeak !'
  6. sourceperl created this gist Jun 9, 2016.
    17 changes: 17 additions & 0 deletions setup.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,17 @@
    # install espeak
    sudo apt-get install espeak

    # install mbrola
    wget http://tcts.fpms.ac.be/synthesis/mbrola/bin/raspberri_pi/mbrola.tgz
    tar xvzf mbrola.tgz
    chmod 755 mbrola
    sudo mv ./mbrola /usr/local/bin/

    # install voices for mbrola
    wget http://tcts.fpms.ac.be/synthesis/mbrola/dba/fr1/fr1-990204.zip
    sudo unzip fr1-990204.zip -d /opt/mbrola
    sudo mkdir -p /usr/share/mbrola/voices/
    sudo cp -r /opt/mbrola/fr1/* /usr/share/mbrola/voices/

    # test it !
    espeak -x -q -v mb/mb-fr1 'installation terminé. On peux maintenant utiliser espeak !'