I know there're a few programs use on Windows that will accomplish what you mentioned,one that comes to mind is Dragon Naturally Speaking. You can read about it here; Dragon Naturally Speaking
According to the article you may be able to run Dragon Naturally Speaking using Wine for Ubuntu, I use it on Windows many time and it work GREAT. I hope this will point you in the right direction
There are a few others you might want to try I did a search in the Ubuntu Software center and found one called Simon it can be installed on Ubuntu Linux using the Software center