TTS Prioritisation

I am going to use RabbitMQ to receive phrases to be spoken by piper.

Overview

  • Single RabbitMQ channel/ routing key called tts. A message can have a priority.
  • Message seem to be read from the queue in teh order they arrive, priority seems to do nothing except can get with the message.
  • So I need to write something which takes messages from the channel and saves them to an sqlite3 in memory database.
  • when a message arrives it should wake the queue processor.
  • on waking/ finishing speaking a phrase it should ** read any messages in the tts channel, saving them to the dB ** select the oldest of the highest priority messages, ** (to-do) if it has expired delete it and restart ** speak the message, then delete the message from the dB ** repeat this loop ** if there are no messages in the dB or the tts channel then sleep for a time or until woken by a webhook/ semaphore.