• Models
  • Contests
  • Slicer
  • Login
  • Start Here
    thingiverse-iconprintables-iconcults3d-iconmakerworld-iconmyminifactory-icon

    3D GO

    3D ModelsContestsCollectionsSaved ModelsOn a mobile device?

3D GO

Privacy Policy
FYSETC Macro Button - TTS Magic 8 Ball 3D Printer File Image 1
FYSETC Macro Button - TTS Magic 8 Ball 3D Printer File Image 2
FYSETC Macro Button - TTS Magic 8 Ball 3D Printer File Image 3
FYSETC Macro Button - TTS Magic 8 Ball 3D Printer File Image 4
FYSETC Macro Button - TTS Magic 8 Ball 3D Printer File Image 5
FYSETC Macro Button - TTS Magic 8 Ball 3D Printer File Image 6
FYSETC Macro Button - TTS Magic 8 Ball 3D Printer File Image 7
FYSETC Macro Button - TTS Magic 8 Ball 3D Printer File Image 8
FYSETC Macro Button - TTS Magic 8 Ball 3D Printer File Thumbnail 1
FYSETC Macro Button - TTS Magic 8 Ball 3D Printer File Thumbnail 2
FYSETC Macro Button - TTS Magic 8 Ball 3D Printer File Thumbnail 3
FYSETC Macro Button - TTS Magic 8 Ball 3D Printer File Thumbnail 4
FYSETC Macro Button - TTS Magic 8 Ball 3D Printer File Thumbnail 5
FYSETC Macro Button - TTS Magic 8 Ball 3D Printer File Thumbnail 6
FYSETC Macro Button - TTS Magic 8 Ball 3D Printer File Thumbnail 7
FYSETC Macro Button - TTS Magic 8 Ball 3D Printer File Thumbnail 8

FYSETC Macro Button - TTS Magic 8 Ball

YourBuddyDinec avatarYourBuddyDinec

October 18, 2023

printables-icon
DescriptionCommentsTags

Description

A button for you to push (or call from a START_PRINT macro that plays a text to speech Magic 8 Ball. Included both single and multicolor models in case you're lucky enough to have a FYSETC ERCF kit.

To get the macro to work you need the following:

GCode Shell Commands - Installable through Kiauh
Espeak - sudo apt install espeak
Aplay - sudo apt install aplay
A set of speakers - Cheap ones do fine. Connected to your printer through the Computer running klipper or a usb hub with a headphone jack out. (If needed I can make a separate macro for a USB hub audio out since it needs a command added)
tts_espeak.sh - included in files. Unzip and place in ~/printer_data/scripts/

The script allows you at edit the voice (m/f) and type (1-5) along with a voice speed so you can customize your voice.

Use this code to check the TTS settings you are using
[gcode_macro TTS_SETTINGS]
###########You can edit the TTS settings below here###########
variable_tts_voice_type: 'f' # options are f and m
variable_tts_voice_number: 5 # choices are 1-5
variable_tts_voice_speed: 150 # epeak default is 100
###########You can edit the TTS settings above here###########
gcode:
   M118 Your TTS Voice Type is {printer["gcode_macro TTS_SETTINGS"].tts_voice_type} and the number is {printer["gcode_macro TTS_SETTINGS"].tts_voice_number}/5
   M118 And will be played at {printer["gcode_macro TTS_SETTINGS"].tts_voice_speed}% speed.

The actual TTS Command. You can also do TTS MSG=<message> and it will talk.
[gcode_macro TTS]
gcode:
   {% set TTS_MSG    = params.MSG|default('BOOP') %}
   {% set TTS_GENDER = printer["gcode_macro TTS_SETTINGS"].tts_voice_type %}
   {% set TTS_NUMBER = printer["gcode_macro TTS_SETTINGS"].tts_voice_number %}
   {% set TTS_SPEED  = printer["gcode_macro TTS_SETTINGS"].tts_voice_speed %}
   
   RUN_SHELL_COMMAND CMD=TTS_SHELL PARAMS='{TTS_GENDER} {TTS_NUMBER} {TTS_SPEED} "{TTS_MSG}"'

And heres the Magic 8 Ball Command
[gcode_macro MAGIC_EIGHT_BALL]
gcode:
 {% set num_songs = params.numsongs|default(20)|int %}
 {% set random_int = (range(1, num_songs+1) | random) %}
 ########## Good Responses ##########
 {% if random_int|int == 1 %} #1
     {% set m8b_msg = "It is certain" %}
 {% elif random_int|int == 2 %} #2
     {% set m8b_msg = "It is decidedly so" %}
 {% elif random_int|int == 3 %} #3
     {% set m8b_msg = "Without a doubt" %}
 {% elif random_int|int == 4 %} #4
     {% set m8b_msg = "Yes definitely" %}
 {% elif random_int|int == 5 %} #5
     {% set m8b_msg = "You may rely on it" %}
 {% elif random_int|int == 6 %} #6
     {% set m8b_msg = "As I see it, yes" %}
 {% elif random_int|int == 7 %} #7
     {% set m8b_msg = "Most likely" %}
 {% elif random_int|int == 8 %} #8
     {% set m8b_msg = "Outlook good" %}
 {% elif random_int|int == 9 %} #9
     {% set m8b_msg = "Yes" %}
 {% elif random_int|int == 10 %} #10
     {% set m8b_msg = "Signs point to yes" %}
 ########## Neutral Responses ##########
 {% elif random_int|int == 11 %} #11
     {% set m8b_msg = "Reply hazy, try again" %}
 {% elif random_int|int == 12 %} #12
     {% set m8b_msg = "Ask again later" %}
 {% elif random_int|int == 13 %} #13
     {% set m8b_msg = "Better not tell you now" %}
 {% elif random_int|int == 14 %} #14
     {% set m8b_msg = "Cannot predict now" %}
 {% elif random_int|int == 15 %} #15
     {% set m8b_msg = "Concentrate and ask again" %}
 ########## Negative Responses ##########
 {% elif random_int|int == 16 %} #16
     {% set m8b_msg = "Don’t count on it" %}
 {% elif random_int|int == 17 %} #17
     {% set m8b_msg = "My reply is no" %}
 {% elif random_int|int == 18 %} #18
     {% set m8b_msg = "My sources say no" %}
 {% elif random_int|int == 19 %} #19
     {% set m8b_msg = "Outlook not so good" %}
 {% elif random_int|int == 20 %} #20
     {% set m8b_msg = "Very doubtful" %}  
 {% endif %}

 M118 The Magic 8 Ball says...
 TTS MSG="The Magic 8 Ball says..."
 M118 ...{m8b_msg}!
 TTS MSG="{m8b_msg}"

License:

Creative Commons — Attribution

Related Models

#3DBenchy - The jolly 3D printing torture-test by CreativeTools.se preview image

#3DBenchy - The jolly 3D printing torture-test by CreativeTools.se

CreativeTools profile image

CreativeTools

90,821

Important information sign for 3D printers / Wichtiges Hinweisschild für 3D-Drucker :) preview image

Important information sign for 3D printers / Wichtiges Hinweisschild für 3D-Drucker :)

Pat_S profile image

Pat_S

sign: don't touch my 3d printer preview image

sign: don't touch my 3d printer

Izzodesign74 profile image

Izzodesign74

541

Self-Watering Planter (Small) preview image

Self-Watering Planter (Small)

parallelgoods profile image

parallelgoods

73,098

X, Y and Z calibration tool for IDEX / dual extruder / dual color 3D printers preview image

X, Y and Z calibration tool for IDEX / dual extruder / dual color 3D printers

Voxel3D_NL profile image

Voxel3D_NL

202

Gift Box preview image

Gift Box

roby85r profile image

roby85r

1,497

All In One 3D Printer test preview image

All In One 3D Printer test

majda107 profile image

majda107

64,448

axes calibrage cube-xyz for 3d printers preview image

axes calibrage cube-xyz for 3d printers

H- printed profile image

H- printed

9

7