How Do you Play Sounds?

Jonnycakes

New Member
Reaction score
6
I did some searching, but didn't find anything helpful-How do you play sounds that are already included in the game? For example...

JASS:
call PlaySound("Units\\Creeps\\PandarenBrewmaster\\PandarenBrewmasterWarcry1.wav")


...doesn't work. What format do I need to use for the sound string to get it to play properly?
 

Jonnycakes

New Member
Reaction score
6
I don't think it's a syntax error-I think the path for the sound I have is wrong. I used the example function that I posted, but it didn't play the sound. What did I do wrong?
 

PurgeandFire

zxcvmkgdfg
Reaction score
509
This is how blizzard does their generated sounds, if it helps:
JASS:
function InitSounds takes nothing returns nothing
    set gg_snd_PandarenBrewmasterWarcry1 = CreateSound("Units\\Creeps\\PandarenBrewmaster\\PandarenBrewmasterWarcry1.wav" , false , true , true , 10 , 10 , "HeroAcksEAX")
    call SetSoundParamsFromLabel(gg_snd_PandarenBrewmasterWarcry1 , "PandarenBrewmasterWarcry")
    call SetSoundDuration(gg_snd_PandarenBrewmasterWarcry1 , 2548)
endfunction


I think SetSoundParams... only works if you have it "used as a sound" in the sound editor, but I am not sure.

You can just mess around with the SetSound natives if you want.
JASS:
native SetSoundChannel              takes sound soundHandle, integer channel returns nothing
native SetSoundConeAngles           takes sound soundHandle, real inside, real outside, integer outsideVolume returns nothing
native SetSoundConeOrientation      takes sound soundHandle, real x, real y, real z returns nothing
native SetSoundDistanceCutoff       takes sound soundHandle, real cutoff returns nothing
//usually 100,000
native SetSoundDistances            takes sound soundHandle, real minDist, real maxDist returns nothing
//min 3,000 max 10,000 for usual sounds
native SetSoundDuration             takes sound soundHandle, integer duration returns nothing
//milliseconds
native SetSoundPitch                takes sound soundHandle, real pitch returns nothing
//1
native SetSoundVelocity             takes sound soundHandle, real x, real y, real z returns nothing
native SetSoundVolume               takes sound soundHandle, integer volume returns nothing
//usually 127


Overall though, it might be more efficient to just use the sound editor and use blizzard's generated globals.
 

Jonnycakes

New Member
Reaction score
6
Well, I tried the BJ that I posted in my first post, and I also tried using the functions called in said BJ, but nothing happened. Thank you for the clarification on what is actually happening with the sound initialization, but it still won't work. +rep anyway
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top