ID:155086
 
Does BYOND's sound channels ONLY work with WAV files? So if I were to use an OGG file, play it in the background, there would be no way to layer it, repeat it, or stop it without building a custom system?

I'm thrown off by this line here from the reference: channel: 0 for any available channel, 1-8 for specific channel (wavs only)

I don't think I'd even be asking this question except I've been frustrating myself with attempts to use an OGG for background music, and then have it switch off when I logout of the starting mob.

To stop the sound by channel I'm attempting:
src<<sound(null,,1,0)
Looks like that part of the reference wasn't updated. Anywho, the specific page for channel states:

"set to 1 through 1024 to choose a specific sound channel"
In response to DarkCampainger
how about trying this
proc
PlaySound(var/mob/Hearers,file,repeat=0,wait,channel,VolChannel="Effect")
if(ismob(Hearers))
if(Hearers.vars["Volume[VolChannel]"] && !Hearers.VolumeMuteAll) Hearers<<sound(file,repeat,wait,channel,Hearers.vars["Volume[VolChannel]"])
else
for(var/mob/Player/M in Hearers)
if(M.vars["Volume[VolChannel]"] && !M.VolumeMuteAll) M<<sound(file,repeat,wait,channel,M.vars["Volume[VolChannel]"])

mob/var
//Volume
VolumeMuteAll=0
VolumeEffect=100
VolumeVoice=100
VolumeMenu=100
VolumeMusic=100

its not something i have done its what falacy do in his game and it supports all format byond does
In response to Hassanjalil
Hassanjalil wrote:
how about trying this
> proc
> PlaySound(var/mob/Hearers,file,repeat=0,wait,channel,VolChannel="Effect")
> if(ismob(Hearers))
> if(Hearers.vars["Volume[VolChannel]"] && !Hearers.VolumeMuteAll) Hearers<<sound(file,repeat,wait,channel,Hearers.vars["Volume[VolChannel]"])
> else
> for(var/mob/Player/M in Hearers)
> if(M.vars["Volume[VolChannel]"] && !M.VolumeMuteAll) M<<sound(file,repeat,wait,channel,M.vars["Volume[VolChannel]"])
>
> mob/var
> //Volume
> VolumeMuteAll=0
> VolumeEffect=100
> VolumeVoice=100
> VolumeMenu=100
> VolumeMusic=100

its not something i have done its what falacy do in his game and it supports all format byond does

Don't use someone else programming, make YOURS.
In response to Ocean King
Ocean King wrote:
Hassanjalil wrote:
how about trying this
> > proc
> > PlaySound(var/mob/Hearers,file,repeat=0,wait,channel,VolChannel="Effect")
> > if(ismob(Hearers))
> > if(Hearers.vars["Volume[VolChannel]"] && !Hearers.VolumeMuteAll) Hearers<<sound(file,repeat,wait,channel,Hearers.vars["Volume[VolChannel]"])
> > else
> > for(var/mob/Player/M in Hearers)
> > if(M.vars["Volume[VolChannel]"] && !M.VolumeMuteAll) M<<sound(file,repeat,wait,channel,M.vars["Volume[VolChannel]"])
> >
> > mob/var
> > //Volume
> > VolumeMuteAll=0
> > VolumeEffect=100
> > VolumeVoice=100
> > VolumeMenu=100
> > VolumeMusic=100

its not something i have done its what falacy do in his game and it supports all format byond does

Don't use someone else programming, make YOURS.

Haha. Good advice, but I think you'll find that I've been around quite a while and have programmed quite a bit. I even have: http://www.byond.com/developer/Rockinawsome/SoundTags
But it's not as perfect (or as finished) as I would like. It is very difficult to find a way to stop playing a looping OGG file. I could mute it, but that means it's still playing it, which isn't good for obvious reasons.
In response to DarkCampainger
Well you led me to what I thought was an obvious mistake of mine, I believed:
src<<sound(null,,1,0)

was the obvious problem, as the channel wasn't placed in the correct parameter, silly me. However, upon correction:
src<<sound(null,,,1,0)

Nothing seems to change. So I thought, maybe the wait parameter needs to be set to 0, so I filled in all of the parameters (probably a good habit anyway, but laziness being what it is...):
src<<sound(null,0,0,1,0)

Yet still the sound plays without interruption.
In response to Rockinawsome
hah well u can just do simple thing such as
PlaySound(view(),null,channel=Same Channel u want to stop music)
and for play
PlaySound(view(),File,channel=Channnel, VolChannel="Effects")
In response to Rockinawsome
I'm not sure why your getting a problem, so long as your music/sound that your trying to stop is the same channel as the sound stopper, it should work. Though you can used named arguments with sound, so you can just do src << sound(channel=1) assuming you played your music on channel 1. I actually use higher channels for music though, just in case you overlap a sound effect or something with a low channel.
In response to Megablaze
Megablaze wrote:
I'm not sure why your getting a problem, so long as your music/sound that your trying to stop is the same channel as the sound stopper, it should work. Though you can used named arguments with sound, so you can just do src << sound(channel=1) assuming you played your music on channel 1. I actually use higher channels for music though, just in case you overlap a sound effect or something with a low channel.

I had same problem sometimes.

I had to rewrote all my code. doing 'null' should work, though. That's how i do it.