The new iMacs have optical output, too. You don't need to convert to analog stereo miniplug.
All you need is either another an optical cable that has a regular TOSlink plug at one end and the optical miniplug at the other, or a cable with TOSlink plugs at both ends, plus a plug adapter for one end.
Here's one vendor that sells the adapter for under $2. They also have whole cables for really, really cheap.
tooki