As the guys are showing, there is no shortage of sound modules from Radio Shack, eBay, model train suppliers, etc. Most are limited to seconds or a couple minutes due to what amounts to an analog sound storage technology albeit on an IC chip. These are less than $10. In any case you need to convert the track AC voltage to the required DC voltage adding powered-trucks if just a plain boxcar, provide a bigger speaker - perhaps adding a small audio amp module. Comparing to our engines, you need audio power in the several Watts range to be effective.
But the real trick is getting the TMCC/DCS command control - I assume you only need on/off triggering rather than full audio control (changing volume, selecting from individual sounds at will, etc.). There is nothing available for DCS so I believe one of the ERR modules as GRJ shows is your only option. I think the lowest-cost solution to basic on/off control under TMCC is their dummy engine "Mini Commander EX" for $25. Then there are some logistical issues such as adding the infamous DCS-choke if you might be using this on a DCS layout, and determining if the ERR module has a controllable output that provides a suitable voltage to drive the sound module, and so on.
Some other thinking outside the box(car) ideas. You can buy a remote control link for less than $10 on eBay as shown below. In this case there's a small fob with a button that opens/closes the relay on a remote module. So you could hook the transmitter to a TMCC ASC or DCS AIU accessory module and send the remote control on/off to the boxcar which has the relay module. The relay then controls your sound module. This would save a few bucks but of course requires some DIY handi-work to open up the transmitter and wire the switch into the ASC or AIU, etc.
Yet another idea is to simply transmit the sound using a wireless mic modules, a "walkie-talkie", whatever. Some of these wireless links like for TV headsets have remarkably hi-fidelity sound. Again, an ASC or AIU can switch on the transmitter to remotely trigger the sound in the boxcar. The sound would come from anything local - boombox, tape recorder, PC, etc. But again, lots of DIY handi-work.