When to use or not an optocoupler
The 4N25 is unsuitable for this kind of application. Rise and fall times will be more like 20usec in realistic situations (not 100 ohms load). It's fine for really slow stuff like relay or switch detection, but not for fast PWM.

Use a very common and cheap 6N137 which has &lt; 100ns response times. Then you can increase your PWM frequency to avoid the noise. If you have a good design you may be able to move it above the audible range.