I'm looking to create an iphone app to help people monitor whether they are experiencing hearing loss from turning up the sound too high on their earbuds for a research project.
To do this, I want to periodically poll the volume level when music is playing on the iphone and the headphones are plugged in.
I did find the following answers that indicate it is possible however I am not familiar with iphone development.
checking when the audio is playing on the phone Can my app be notified when another application starts/stops playing audio?
check if headphones are plugged in Are headphones plugged in? iOS7
checking the volume level on the phone https://stackoverflow.com/a/29170927/1361960