iPad Dictation
Any time the keyboard is open to input text there is a dictation icon next to the spacebar:
Simply tap this to start dictation.
iPad Text to Speech
There are a couple of options you will need to turn on to get test to speech to work on your iPad. Open the Settings app, tap General, Accessibility and then Speech. Turn on the first two options:
Now when you are in an app you can select any text (by tapping and holding, and dragging the cursors around the text) and tap Speak:
You can now also swipe down with two fingers from the top of the screen and the iPad will start reading aloud text, beginning at the top of the page. Some controls will also appear that allow you to speedup, slowdown and move the speaking position around the page:
MacBook Dictation
This was written for older versions of macOS. For Mojave onwards there is a good guide here.
On a MacBook, to turn on dictation you need to go to System Preferences and click on the Dictation & Text to Speech icon:
From the dictation tab you can then turn dictation on (you can also enable enhanced dictation if you think you will be using this tool a lot with ESL students to improve the accuracy):
You can now use the keyboard shortcut to use dictation in any app, just press the function (fn) key twice.
MacBook Text to Speech
To turn on text to speech you need to be in the same section of System Preferences as above, then click the Text to Speech tab at the top:
Now select the option that says Speak selected text when the key is pressed. The default key to get this to work in an app is Option+Esc. Any text you have selected when you press that key combination will be spoken out-loud by the computer.