+# ifdef HAVE_PULSE
+ if (!backend_env || (strcasecmp (backend_env, "Pulse") == 0))
+ res = _pulse_init (name, ctx);
+ if (!res)
+#endif
+ res = _alsa_init (name, ctx);
+
+ if (!res)
+ fprintf (stderr, "Could not initialize Audio backend\n");
+
+ return res;
+}
+
+void _backend_free (audioCtxHandleT *ctx) {
+
+# ifdef HAVE_PULSE
+ if (ctx->audio_dev) _pulse_free (ctx); else
+# endif
+ _alsa_free (ctx->name);
+}
+
+void _backend_play (audioCtxHandleT *ctx) {
+
+# ifdef HAVE_PULSE
+ if (ctx->audio_dev) _pulse_play (ctx); else
+# endif
+ _alsa_play (ctx->idx);
+}
+
+void _backend_stop (audioCtxHandleT *ctx) {
+
+# ifdef HAVE_PULSE
+ if (ctx->audio_dev) _pulse_stop (ctx); else
+# endif
+ _alsa_stop (ctx->idx);
+}
+
+unsigned int _backend_get_volume (audioCtxHandleT *ctx, unsigned int channel) {
+
+# ifdef HAVE_PULSE
+ if (ctx->audio_dev) return _pulse_get_volume (ctx, channel); else
+# endif
+ return _alsa_get_volume (ctx->idx, channel);
+}
+
+void _backend_set_volume (audioCtxHandleT *ctx, unsigned int channel, unsigned int vol) {
+
+# ifdef HAVE_PULSE
+ if (ctx->audio_dev) _pulse_set_volume (ctx, channel, vol); else
+# endif
+ _alsa_set_volume (ctx->idx, channel, vol);
+}
+
+void _backend_set_volume_all (audioCtxHandleT *ctx, unsigned int vol) {
+
+# ifdef HAVE_PULSE
+ if (ctx->audio_dev) _pulse_set_volume_all (ctx, vol); else
+# endif
+ _alsa_set_volume_all (ctx->idx, vol);
+}
+
+unsigned char _backend_get_mute (audioCtxHandleT *ctx) {
+
+# ifdef HAVE_PULSE
+ if (ctx->audio_dev) return _pulse_get_mute (ctx); else
+# endif
+ return _alsa_get_mute (ctx->idx);
+}
+
+void _backend_set_mute (audioCtxHandleT *ctx, unsigned char mute) {
+
+# ifdef HAVE_PULSE
+ if (ctx->audio_dev) _pulse_set_mute (ctx, mute); else
+# endif
+ _alsa_set_mute (ctx->idx, mute);
+}
+
+void _backend_set_channels (audioCtxHandleT *ctx, unsigned int channels) {
+
+# ifdef HAVE_PULSE
+ if (ctx->audio_dev) return; else
+# endif
+ _alsa_set_channels (ctx->idx, channels);
+}