I've got a rooted Samsung Galaxy S3 with a bad IMEI that I use to listen to music in the office from time to time. Every once in a while, the music player (slacker radio) will 'hiccup' and start playing if previously paused. If I don't have my headphones plugged in, the music will start playing through the external speaker. I NEVER use the S3 in speakerphone mode or listen to music without headphones. Also, since the phone has a bad IMEI, it can't be on my network, so I basically use the phone as a small tablet/mp3 player (no need to worry about losing the phone ringtone).
Since the phone is rooted, is there a way I can change/remove some /system file to disable the speaker? I don't want to install an app to disable the speaker since that was a failed experiment. I had an HTC Evo 4G that I pulled the phone apart and removed the speaker all together. I would do that here, but it doesn't look like it would be as easy as it was on the EVO.