  We calculate the yield of high energy neutrinos produced in astrophysical
sources for arbitrary interaction depths $\tau_0$ and magnetic field strengths
$B$. We take into account energy loss processes like synchrotron radiation and
diffusion of charged particles in turbulent magnetic fields as well as the
scattering of secondaries on background photons and the direct production of
charm neutrinos. Meson-photon interactions are simulated with an extended
version of the SOPHIA model. Diffusion leads to an increased path-length before
protons leave the source of size R_s and therefore magnetized sources lose
their transparency below the energy $E\sim 10^{18}{\rm eV} (R_s/{\rm pc})
(B/{\rm mG}) \tau_0^{1/\alpha}$, with $\alpha=1/3$ and 1 for Kolmogorov and
Bohm diffusion, respectively. Moreover, the neutrino flux is suppressed above
the energy where synchrotron energy losses become important for charged
particles. As a consequence, the energy spectrum and the flavor composition of
neutrinos are strongly modified both at low and high energies even for sources
with $\tau_0\lsim 1$.
