import random
import os

from microbit import *

if 'messages.txt' in os.listdir():

    with open('messages.txt') as message_file:
        messages = message_file.read().split('\n')

    while True:
        if button_a.was_pressed():
            display.scroll(random.choice(messages))

import random
import os
import speech

from microbit import *

if 'messages.txt' in os.listdir():

    with open('messages.txt') as message_file:
        messages = message_file.read().split('\n')

    while True:
        if button_a.was_pressed():
            speech.say(random.choice(messages))

Change output in fs-demo to voice.
Change output in fs-demo to voice.

  import random
  import os
+ import speech
  
  from microbit import *
  
  if 'messages.txt' in os.listdir():
  
      with open('messages.txt') as message_file:
          messages = message_file.read().split('\n')
  
      while True:
          if button_a.was_pressed():
-             display.scroll(random.choice(messages))
+             speech.say(random.choice(messages))
  
Change output in fs-demo to voice.
## Code Before:
import random
import os

from microbit import *

if 'messages.txt' in os.listdir():

    with open('messages.txt') as message_file:
        messages = message_file.read().split('\n')

    while True:
        if button_a.was_pressed():
            display.scroll(random.choice(messages))

## Instruction:
Change output in fs-demo to voice.
## Code After:
import random
import os
import speech

from microbit import *

if 'messages.txt' in os.listdir():

    with open('messages.txt') as message_file:
        messages = message_file.read().split('\n')

    while True:
        if button_a.was_pressed():
            speech.say(random.choice(messages))
