play

Play a game in a window. Like simulate, but you manage your own input events.
Play a round of the game, making the solver guess the secret number 42. Note that you can generate a random-number and make the solver guess it too! We have:
>>> play
Current bounds: (0,1000)
Current bounds: (21,1000)
Current bounds: (31,1000)
Current bounds: (36,1000)
Current bounds: (39,1000)
Current bounds: (40,1000)
Current bounds: (41,1000)
Current bounds: (42,1000)
Solved in: 8 guesses:
8 21 31 36 39 40 41 42
First, we define a play routine for lazy storable vectors. Storable lazy vectors are lazy lists of low-level arrays. They are both efficient in time and memory consumption, but the blocks disallow feedback by small delays. Elements of a storable vector must be of type class Storable. This means that elements must have fixed size and advanced data types like functions cannot be used.
For the following examples we will stick to monophonic sounds played at 44100 Hz. Thus we define a function for convenience.
play applied to an Initial source will promote the source to Playing, thus the data found in the buffer will be fed into the processing, starting at the beginning. play applied to a Playing source will restart the source from the beginning. It will not affect the configuration, and will leave the source in Playing state, but reset the sampling offset to the beginning. play applied to a Paused source will resume processing using the source state as preserved at the pause operation. play applied to a Stopped source will propagate it to Initial then to Playing immediately.
Begin/continue playing.
Begin playback (optionally at a specific position).
Play a Chunk once, using the first available Channel.
Execute an action with the given tape in read mode.
  • Replay interactions that have been recorded earlier.
  • Fail on new interactions that do not yet exist on the tape.
Use play when you want to test against recorded responses while at the same time also deny real HTTP requests for interactions that have not been recorded.
Resume the AudioDevice.
Play audio signals via ALSA. The module could also be called Output, because with a file sink, data can also be written to disk.