How Toshiba automatically switches between headphones and built-in speakers.
First open the Smart Audio software in the "Control Panel"
Then In the "Audio Director", click "Advanced" and then select the "Configuration" option
Then in the window that appears, select "Redirect audio from built-in speakers to headphones" and select OK. That's it. In the future, it will automatically switch as long as the earphones are plugged in, and they will automatically switch to speakers if they are pulled out.