Raised This Month: $51 Target: $400
 12% 

[Workarounded] [CS:GO] Play custom .wav sound without snd_rebuildaudiocache?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Kinsi
Senior Member
Join Date: Apr 2013
Old 06-15-2017 , 10:35   [Workarounded] [CS:GO] Play custom .wav sound without snd_rebuildaudiocache?
Reply With Quote #1

Hoi,

im currently trying to play a custom .wav sound of mine. I am aware of the CS:GO * hack to play custom sounds, and it generally works. Any custom .mp3 sounds work fine right after downloading, however the .wav sound does not work unless snd_rebuildaudiocache is ran on each and every client. The reason this one sound is a wav because i need it to be looping, which is only possible w/ waves in the source engine.

When trying to play the sound without rebuilding the audio cache it will just spew out the cant create mixer error.

Is there any solution to this or am i just doing something wrong possibly? Saved the sound as a compressed wav w/ 44100 Khz, like i said generally the sound works.

Last edited by Kinsi; 06-16-2017 at 09:41.
Kinsi is offline
8guawong
AlliedModders Donor
Join Date: Dec 2013
Location: BlackMarke7
Old 06-15-2017 , 12:11   Re: [CS:GO] Play custom .wav sound without snd_rebuildaudiocache?
Reply With Quote #2

Fake client command play something. wav
8guawong is offline
Kinsi
Senior Member
Join Date: Apr 2013
Old 06-15-2017 , 12:53   Re: [CS:GO] Play custom .wav sound without snd_rebuildaudiocache?
Reply With Quote #3

Same issue, even when trying to play it from the console with the play command directly it requires me to rebuild the audio cache.
Kinsi is offline
Kinsi
Senior Member
Join Date: Apr 2013
Old 06-15-2017 , 16:05   Re: [CS:GO] Play custom .wav sound without snd_rebuildaudiocache?
Reply With Quote #4

Just tried it out to confirm: The issue is not related to the compressed wave format, it doesnt work with uncompressed wave either. It is something weird with *.wav files. Mp3 works just fine, but wave forces me to explicitly rebuild the audio cache. No matter how often i restart CS:GO it will always tell me the file is missing from disk.
Kinsi is offline
Totenfluch
AlliedModders Donor
Join Date: Jan 2012
Location: Germany
Old 06-16-2017 , 08:58   Re: [CS:GO] Play custom .wav sound without snd_rebuildaudiocache?
Reply With Quote #5

Probably unrelated but did you preload the sound in the precache?

Also I have this strange bug that sounds related: On my Computer I have to regulary rebuild my sound cache because I did it once. On my Laptop everything works perfectly fine and I've never rebuild the sound cache once. My guess ist that if you rebuild your sound cache once something gets permamently screwed.


EDIT: some more info

"All of the listed workarounds involve explicitly telling the client to stream the sound directly from the disk rather than starting it from the cache. This is less than ideal, but seems to work well enough. These have only been made to work with mp3 files. A way to support wav files has not yet been found."

"Recent reports indicate that this only works for mp3s and not wavs. In the latter case nothing will happen apart from you experiencing puzzled facial expressions and headaches on yourself."

Source: https://wiki.alliedmods.net/Csgo_quirks


This may be a Lead for you tho

Using the music directory
By adding your custom sounds under sound/music/, they will automatically be streamed from disk. They can also be used just like sounds in any other game with regard to PrecacheSound (albeit not necessary to be beyond adding to soundprecache table) and EmitSound.

This will have the side effect of your sounds volume being tied to the game's music volume, which many players turn down or off. For this reason, it's not recommended.


regards
__________________
Notable Projects:
Event Item Spawner | Scissors, Rock, Paper for ZephStore
tVip | Smart Link Remover
PLG & GGC - CS:GO Roleplay

and countless more...

I can make a helicopter shoot missles if you want me to...

Last edited by Totenfluch; 06-16-2017 at 09:08.
Totenfluch is offline
Kinsi
Senior Member
Join Date: Apr 2013
Old 06-16-2017 , 09:37   Re: [CS:GO] Play custom .wav sound without snd_rebuildaudiocache?
Reply With Quote #6

Yes, the sound is precached. Everything is exactly the same way as with the custom mp3 files that are in the same folder. I have tested this with multiple people and everyone has the same issue where the custom .wav file wont play unless they rebuild the audio cache.

I have however now found a workaround which works for me: Since this is for a custom gamemode of mine which has its own custom map i've just packed the sounds into the map. Not only has this the positive side-effect that people cannot downloadfilter the sounds, playing the wav now works just fine!

Thank you though. If i should ever need a custom wave sound in the future ill try out the music folder, thanks

Last edited by Kinsi; 06-16-2017 at 09:38.
Kinsi is offline
_GamerX
AlliedModders Donor
Join Date: Jun 2011
Location: Fun Server
Old 09-07-2017 , 03:17   Re: [CS:GO] Play custom .wav sound without snd_rebuildaudiocache?
Reply With Quote #7

Quote:
Originally Posted by Kinsi View Post
Yes, the sound is precached. Everything is exactly the same way as with the custom mp3 files that are in the same folder. I have tested this with multiple people and everyone has the same issue where the custom .wav file wont play unless they rebuild the audio cache.

I have however now found a workaround which works for me: Since this is for a custom gamemode of mine which has its own custom map i've just packed the sounds into the map. Not only has this the positive side-effect that people cannot downloadfilter the sounds, playing the wav now works just fine!

Thank you though. If i should ever need a custom wave sound in the future ill try out the music folder, thanks
Players can still download sounds from .bsp file.
__________________
_GamerX is offline
Send a message via ICQ to _GamerX Send a message via Skype™ to _GamerX
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 23:58.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode