Can an optocoupler be used as a switch
The output of a "normal" optocoupler is an NPN transistor.  It is very good at switching a low current DC voltage.  It is not very good at switching an AC signal such as audio.

There are optocouplers with MOSFET and TRIAC outputs that are better for AC signals, but they have their own quirks.  Without knowing more about the signal you want to switch, and explaining what "bidirectional stuff" is, how do you expect any kind of clear answer?