Custom Sounds
Posted: Tue Oct 27, 2015 3:09 pm
Currently am trying to get custom sounds working for a server I am working on. Am using the Sound class available and have tried playing the sound on my end after the download happens.
The download works perfectly and anyone who joins downloads the file without error. However when trying to play the sound I get some sort of "mixer" error.
Using the code below:
The download works perfectly and anyone who joins downloads the file without error. However when trying to play the sound I get some sort of "mixer" error.
Code: Select all
[Sound] S_StartSound(): Failed to load sound 'source-python\wcs\levelup.mp3'. Can't create mixer.
Using the code below:
Syntax: Select all
from events import Event
from engines.sound import Sound
from filters.recipients import RecipientFilter
from players.entity import PlayerEntity
from players.helpers import index_from_userid
levelup = Sound(None, 0, 'source-python/wcs/levelup.mp3', download=True)
@Event('player_jump')
def player_jump(event):
player = PlayerEntity(index_from_userid(event.get_int('userid')))
levelup.index = player.index
levelup.play(RecipientFilter())