I’m not a C++ programmer. It’s been a few years since I’ve played with this but I’ve had mod-script-pipe working with Python and with BASH. I’d imagine that C++ also supports pipes.
It’s rather complex because Audacity is not a “file player”.
Audacity projects are made up of “blocks” of data that are managed by an XML structure. For cross-platform support Audacity uses PortAudio to handle audio I/O http://www.portaudio.com/
“Play” commands are handled through src/toolbars/ControlToolBar.cpp (see ControlToolBar::OnPlay)