Staredit Network > Forums > SC1 UMS Mapmaking Assistance > Topic: Using WAV sounds
Using WAV sounds
Feb 15 2014, 2:50 pm
By: Stranger  

Feb 15 2014, 2:50 pm Stranger Post #1



I'm really not sure about this but..

Once a WAV file is played in a map, is there a way to cut it or silence it before reaching the end ?

For example, if a WAV file lasts 10 seconds, is there a way to make it stop at 5 ?



None.

Feb 15 2014, 3:09 pm lil-Inferno Post #2

Just here for the pie

The only way to do that is to cut the .wav file into separate files, and play them at the appropriate time sequentially. You can artificially "stop" it by just not playing the next .wav. I'd recommend splitting them in ~2 second files.




Feb 15 2014, 3:30 pm Stranger Post #3



Thank you very much ^^ I'll try this out.



None.

Feb 16 2014, 5:20 pm Stranger Post #4



I can't make it..

I just can't manage to put WAV sounds one after another so they follow each other to make one perfect song without interruption. Timing problem ?

Some WAV sounds end too early and there is a "blank" before the next is played... And sometimes, they are too long and the next WAV plays on the previous.

I separeted the whole thing into several perfect-5-seconds-wav-files... They all last exactly 5 seconds.

Also, when I want the sounds to be played, I use switches. It looks like this :


Trigger
Players
  • Player 7
  • Conditions
  • Play01 is set
  • Actions
  • Wait for 5000 ms
  • Set Play02


  • Trigger
    Players
  • Player 1
  • Conditions
  • Play02 is set
  • Actions
  • Play wav "Part 2"


  • Trigger
    Players
  • Player 1
  • Conditions
  • Play01 is set
  • Actions
  • Play wav "Part 1"


  • Etc.

    The human player has already triggers with Wait action. So I tried to avoid putting in more Waits and used P7 for that. But still, I can't make it work : /

    Is it beacause 5000 starcraft milliseconds are different than 5000 irl milliseconds (on Fastest) ?



    None.

    Feb 16 2014, 5:49 pm Dem0n Post #5

    ᕕ( ᐛ )ᕗ

    Don't use waits. They'll cause wait blocks, which will not only mess up your wavs, but other triggers as well. Instead, use death counters to execute the next trigger. If you're running hyper triggers, it takes approximately one second for 12 deaths to go down to 0 when being subtracted one-by-one (or to go from 0 to 12 when being added one-by-one, whichever you prefer), so in the first trigger, you can set a death to 60, and then make another trigger that constantly subtracts one death of that unit. Then, when the death is at 1, you can play the second wav. You can adjust the deaths of the unit to make the wait longer and shorter, of course.

    I know my explanation probably doesn't make any sense, but if you read through the two articles I linked, you'll probably be able to understand it more. Not to mention, I'm sure someone will post in here with actual example triggers (I'm too lazy for that, sorry).




    Feb 16 2014, 7:04 pm Stranger Post #6



    Thank you Dem0n :)

    These are useful tips indeed and it is true wait blocks ruin everything.

    I'll try this right away.

    I'm about to finalize a 99% done map. It's a metter of hours, but once it's fully done, I'll post it in the Map Showcase forum ^^

    I'll remember to quote your names there for helping out ^^



    None.

    Feb 18 2014, 8:46 am Stranger Post #7



    Hmmm. I figured out the death counter won't work properly without Hypers. And my map hasn't any.

    I might have to remake the whole map in order to make it work with Hypers. So I tried something else to get it done with the WAV sounds part.

    What do you think of using a moving unit to play each WAV ?

    Let's say it's a Reaver that will move from left to right through equaly separeted locations. Reaching the first location will play "Part1.wav", reaching the second location will play the "Part2.wav" etc.. Until reaching the last location (which brings the Reaver at the start and makes it do all the way again).

    Do you think this will work properly or the lack of Hypers will mess up once again ? This might need some good accuracy (using pixels to place the locations).

    ...

    Ok I tried this. There are 14 locations. The WAV transition between the first 5 locations is perfect (nearly perfect for 1 of them), but the next ones aren't that great (I got either a cut of something like 100ms between two transistions, or the previous WAV steps on the next one for something like 100ms). I dunno if I lack precision or is it because the map doesn't use Hypers... I guess it's the second one.

    What about if I decided to put in Hypers (switch based) ? I still have 2 player slots without any triggers (P6 and P7) so I could use them for that. But won't this affect my triggers using Waits, even if they belong to other players (P1 and P2) ?



    None.

    Feb 18 2014, 12:17 pm Oh_Man Post #8

    Find Me On Discord (Brood War UMS Community & Staredit Network)

    I remember having a similar issue. I think the problem was something to do with 84 ms = a single frame. So you have to cut your WAV up until multiples of 84 ms.




    Feb 18 2014, 8:00 pm Sacrieur Post #9

    Still Napping

    The actual figure is 42 ms/frame on fastest. It would be 84 ms per every other frame, which corresponds to the maximum amount of time it would take the triggers to stop playing the WAV.



    None.

    Feb 19 2014, 7:46 am Stranger Post #10



    Ok, thanks :)

    That's some more work to do. I'll have to look into it. Too bad there isn't a "Stop playing WAV" trigger.



    None.

    Options
      Back to forum
    Please log in to reply to this topic or to report it.
    Members in this topic: None.
    [01:37 pm]
    Vrael -- jesus christ that was 2005?
    [09:19 am]
    Linekat -- cool
    [01:56 am]
    Oh_Man -- cool bit of history, spellsword creator talking about the history of EUD ^
    [09:24 pm]
    Moose -- denis
    [05:00 pm]
    lil-Inferno -- benis
    [2024-4-19. : 10:41 am]
    v9bettel -- Nice
    [2024-4-19. : 1:39 am]
    Ultraviolet -- no u elky skeleton guy, I'll use em better
    [2024-4-18. : 10:50 pm]
    Vrael -- Ultraviolet
    Ultraviolet shouted: How about you all send me your minerals instead of washing them into the gambling void? I'm saving up for a new name color and/or glow
    hey cut it out I'm getting all the minerals
    [2024-4-18. : 10:11 pm]
    Ultraviolet -- :P
    Please log in to shout.


    Members Online: jun3hong, NudeRaider