Hello
I just installed Windows 8.1 on my 27inch IMac mid 2010 with Yosemite. I originally had no sound. The sound problems don't have anything to do with whether you have OSX Yosemite or a prior OSX but can be fixed as follows (I suspect its identical on macbooks etc as its really a software problem)
Solution
1. Once you have installed your Windows using Bootcamp Assistant on OSX, you are now booting into Windows. Bootcamp Assistant originally asked you to make a USB disk (asked for a minimum of 8GB). This contains the drivers for your Windows so you must make sure you have the correct version of Bootcamp on this USB. I had the latest Bootcamp that came with Yosemite (April 2015, 10.10.3) and that was version 5.1.xxxx. This version supports win 7, 8 and 8.1 (You'll have to check with Apple which version supports prior OS's like XP or Vista). If you have an older Windows OSX the Apple Bootcamp site ( Boot Camp 5.1: Frequently asked questions - Apple Support ) will be your guide as XP, Vista etc are not really supported much now but there are links in the FAQs.
2. Go to Control Panel and in 'Programmes and Features' (Add/Remove Programmes section) uninstall any audio drivers from RealTek, Cirrus etc. You will be prompted to restart your Mac. Don't do it yet - you need to go to Control Panel->System->DeviceManager and in 'Sound Video and Game Controllers' you need to uninstall anything that says 'High Definition Audio'. (basically, just delete any remaining audio driver here whatever its called - if there are 2 or more copies - delete them all). This is the crux of the problem, the high def audio drivers are the wrong ones, its some kind of clash between sound card and on-motherboard audio, but that's unimportant. When all of these audio drivers are deleted the 'Sound,Video & Game Controllers' section will disappear.
3. Now restart Windows.
4. When rebooted - plug in your original Bootcamp USB you made long ago and navigate to the ' BootCamp' directory, and in that run the 'setup.exe' file. This will reinstall your drivers correctly (note that it Installs a fair bit, don't worry when it installs other stuff too). When it finishes - restart Windows and now you should have sound, as well as a BootCamp Icon in you Task Bar (if it wasn't there previously). If you go to the Device Manager you should see that the 'Sound, Video & Game Controllers' is back, but with the correct audio drivers, usually by RealTek and/or Cirrus.
Hopefully this helps, as there's so much conflicting advice to getting sound working on Windows via Bootcamp.
Stu