Scientists finally figured out how to speak dog! 

A team of researchers from the Technical University of Madrid and Eotvos Lorand University in Budapest used complex algorithms to develop a computer program that translates a dog's bark, reported Telegraph

After analyzing 800 barks of dogs in seven different situations the researchers figured out that the volume, length and pitch of a bark tells a lot about the message a dog is trying to get across. 

The analysis proved that high pitched, rapid barks signals a dog is scared; whereas, a high pitched, slow bark signals a dog is feeling lonely. Deep barks signal the dog is encountering a stranger, while high pitched, clear barks show that the pup is happy. 

Through the research the scientists were also able to correctly predict the sex of the dog 85 percent of the time and the age (young, adult or old) 80 percent of the time, reported Telegraph. 

The researchers reportedly believe that these findings can help veterinarians better identify what is bothering dogs who are brought to them for help. 

This study was the first of its kind to use sound analysis to predict the age and sex of domestic dogs, reported Telegraph. 

The findings were published in the journal "Animal Cognition."