+void S_SetChannelVolume(unsigned int ch_ind, float fvol)
+{
+ sfx_t *sfx = channels[ch_ind].sfx;
+ S_SetChannelVolume_WithSfx(ch_ind, fvol, sfx);
+}
+
+float S_GetChannelPosition (unsigned int ch_ind)
+{
+ // note: this is NOT accurate yet
+ int s;
+ channel_t *ch = &channels[ch_ind];
+ sfx_t *sfx = ch->sfx;
+ if (!sfx)
+ return -1;
+
+ s = ch->pos;
+ /*
+ if(!snd_usethreadedmixing)
+ s += _snd_mixahead.value * S_GetSoundRate();
+ */
+ return (s % sfx->total_length) / (float) S_GetSoundRate();
+}
+
+float S_GetEntChannelPosition(int entnum, int entchannel)
+{
+ channel_t *ch;
+ unsigned int i;
+
+ for (i = 0; i < total_channels; i++)
+ {
+ ch = &channels[i];
+ if (ch->entnum == entnum && ch->entchannel == entchannel)
+ return S_GetChannelPosition(i);
+ }
+ return -1; // no playing sound in this channel
+}