Scientists claim they have finally cracked the code behind the perfect chocolate flavour - and their findings might surprise you.

The sweet treat is made using cocoa beans, which are harvested from trees and left to ferment for five to seven days, before being processed.

But new research has concluded it is the microbes, not cocoa genetics, that hold the key in shaping the flavour.

Dr David Gopaulchan, from the University of Nottingham's school of biosciences, said their research would allow for chocolate to be made with a "consistent quality and flavour profile".

Dr Gopaulchan said the inspiration for the research, published in Nature Microbiology, came from his time working previously at the Cocoa Research Centre in Trinidad.