As PulseAudio (amazingly) doesn't provide any simple query commands, I'm parsing the output from
pacmd list-sinks to get the index of the active sink.
However, I'm not sure what lines actually indicate which sink is active. I know that the index line has an asterisk in front of it if it's the default sink. That doesn't appear to be the same as the active sink, though. When I connect a bluetooth speaker, that's what all audio goes through, nevertheless, sink 0 is still marked as default. When audio is playing, the sink that is outputting it displays 'state: RUNNING'. But once playback stops, that goes back to SUSPENDED.
Is there any reliable way to find out what sink PulseAudio will use for audio?