I want to build a bot/software that can call people over the phone and ask predefined questions to people and store the answers. E.g. such that it could be used to for opinion polling.

I want it to be flexible such that I can change the questions over time, develop the bot to become more sophisticated, change/optimize the speech synthesizer.

Note that I have to use it for the danish language which does not have a lot of speakers. So it seems like I can not use established solutions like Amazon Lex etc.

Can anyone tell me which programs/frameworks that I can use for this? I would prefer to write in Python.

1 Answer 1


From what I can tell, you're looking at five primary components here:

  • The dialer, responsible for placing the initial call, and handling the other phone related aspects.
  • The core survey software, responsible for picking questions and receiving answers.
  • The speech synthesizer, responsible for output to the remote user.
  • The speech recognizer, responsible for input from the remote user.
  • The data storage backend, responsible for storing the answers, and possibly the questions themselves.

In an ideal situation, all of these should be as isolated from each other as reasonably possible so that you can swap out any of the components other than the core without needing any significant work to do so.

Of these five components, the speech recognition part is probably the hardest, so I would actually suggest starting with that. There are a couple of decent FOSS frameworks out there for this, but the only one I've worked with myself is CMU Sphinx (more specifically, the PocketSphinx sub-project). Given that I've only dealt with one, I'm not really the best person to give advice for this component. That said, I can give some general advice. Danish is at least partially mutually intelligible with Swedish and Norwegian. While it won't be an out of box solution, if you can find a FOSS tool for either of these languages, it probably won't take a huge amount of work to adapt it to work with Danish. Norwegian is probably going to be just as hard to find support for as Danish (it's got about the same number of speakers), but Swedish may be significantly easier, as it's got about twice as many native speakers as Danish or Norwegian. If that still fails, start your search with software for other similar languages (unfortunately, all the other north germanic languages have even fewer native speakers than the above three). German may not be the best starting point, but it's significantly closer than English (which is really the black sheep of the germanic languages), and shouldn't be too hard to find.

The speech synthesizer is probably not going to be hard other than finding voice files for Danish. There's about a dozen different FOSS options to pick from. I'm personally a fan of espeak myself, but it probably won't exactly fit what you need (to start with, there is no Danish voice for it as far as I know).

The dialer is easy enough that you can probably write it yourself. Just pick a platform to interact with for the actual calls, and go from there. Even if you end up having to generate dial tones yourself, it's not hard (I've seen DTMF generators in as few as 500 lines of code). If rolling your own, I'd suggest looking into the DSP facilities provided by NumPy and SciPy.

For data storage, some kind of database is pretty much mandatory. You can easily find all kinds of advice on how to pick a particular DB implementation with a quick search online. Pandas may be worth a look as an option for middleware to interface with the database.

The core survey software is likely going to have to be a custom component, simply because the likelihood of finding something that integrates all four other components as you need them to be is pretty low.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.