Does anybody know if there is a way to play back a sound file (.wav)in Windows using the Arduino? I'd like to wire a hardware switch to the Arduino, and whenever I hit the switch it would play the sound in Windows. Can this be done within the Arduino development environment?
There needs to be an application listening to the serial port. What that application does when data arrives on the serial port is limited only by your imagination (and programming ability). Okay, there might be a few hardware limits and permissions issues, too.
If the Arduino sends a message like "Play C:\Temp\HappyDance.wav" to the serial port, and there is an application listening that understands that message, then, yes, the Arduino can do as you propose.
Doing it with the Arduino IDE? No.