A system which allows psychologists to track people's emotional behaviour through their phones has been successfully road-tested by scientists.
St Andrews University researchers have developed in-built phone sensors to work out how people's emotions are influenced by their surroundings.
The system, EmotionSense, uses sensors and speech-recognition software.
It matches the user's voice patterns to recorded speech samples that represent 14 different emotional categories.
The data can then be cross-referenced with other information picked up by the phone, such as where the person is - via GPS - and who they are with, and when - via bluetooth.
The research was also carried out in collaboration with Cambridge University.
The findings are being reported at the Association for Computing Machinery's conference on Ubiquitous Computing in Copenhagen.
St Andrews University researcher, Dr Mirco Musolesi, said: "EmotionSense is potentially a revolutionary platform for social psychologists for understanding human behaviour in an unobtrusive way.
"The possible applications are many: From finding answers to long-standing social psychology problems, such as the influence of interactions on emotional states of people, to supporting behavioural interventions for preventing depressive conditions or promoting well-being in general.
"We are not only inferring emotions during phone calls, but the emotions of the people close to the phones whether in a pub or during a meeting at work.
"The mic of the phone is used as a sort of an open mic in a room that detects voices of all the speakers, identifies them and infers their emotions."
During the study a user's location appeared to have a "pronounced" effect on their state of mind.
"Happy" emotions dominated the data when they were at home, while in the workplace "sad" emotions became the norm.
The researchers also found users showed more intense emotions in the evening than in the morning and that people tended to express their emotions far more in smaller groups than in larger crowds.