Well for a while now my iPhone 3GS thinks it's plugged into the dock when it isn't, and therefore there is no sound. When it's taken out of sleep mode, it will work for a few seconds before going back into dock mode. I had the genius clean it with no success. So I thought a script to force the audio out of the speaker, like Voice Memos can do. I had a thought of removing tty.iap from /dev/ but I don't know if this would stop my iPhone connecting to itunes as well?