Please login or register.

Login with username, password and session length
Advanced search  

News:

IRC channel - server: waelisch.de  channel: #wme (read more)

Author Topic: Sound looping without annoying cut  (Read 4428 times)

0 Members and 1 Guest are viewing this topic.

Mez

  • Lurker
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 6
    • View Profile
Sound looping without annoying cut
« on: May 05, 2010, 11:22:16 AM »

Hey,
I'm currently making a game in Wintermute and I have a very meticulous sound guy who has a problem with the in game looping (through PlayMusic() and PlayMusicChannel() ).
Just by the end, before the music starts again, there's a small audible cut which drives him insane.

Our solution was to cross fade two channels with the same music back and forth when they are over.
This is going to be a whole lot more work to get every different music clip in the various places to loop correctly.

Is there any other way to fade music or to loop it without the annoying cut?

Logged

metamorphium

  • Global Moderator
  • Addicted to WME forum
  • *
  • Karma: 12
  • Offline Offline
  • Gender: Male
  • Posts: 1511
  • Vampires!
    • View Profile
    • CBE  software s.r.o.
Re: Sound looping without annoying cut
« Reply #1 on: May 06, 2010, 09:24:28 AM »

It's a matter of the sound-person. He should create a seamless transition in the sound itself. Wme-wise you can use file preloading to be sure there's no gap. Worked for me, but still the most important part is to the sound work properly.
Logged
J.U.L.I.A. Enhanced Edition, Vampires!, J.U.L.I.A., J.U.L.I.A. Untold, Ghost in the Sheet

Mez

  • Lurker
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 6
    • View Profile
Re: Sound looping without annoying cut
« Reply #2 on: May 06, 2010, 09:52:00 AM »

How would I preload a file like that?
It would please my sound guy to not have to "destroy" his work.
Logged

metamorphium

  • Global Moderator
  • Addicted to WME forum
  • *
  • Karma: 12
  • Offline Offline
  • Gender: Male
  • Posts: 1511
  • Vampires!
    • View Profile
    • CBE  software s.r.o.
Re: Sound looping without annoying cut
« Reply #3 on: May 06, 2010, 09:55:39 AM »

you should use LoadSound / PlaySound (with loop on) feature. Look it up in entity documentation.
Logged
J.U.L.I.A. Enhanced Edition, Vampires!, J.U.L.I.A., J.U.L.I.A. Untold, Ghost in the Sheet

Mez

  • Lurker
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 6
    • View Profile
Re: Sound looping without annoying cut
« Reply #4 on: May 06, 2010, 11:04:21 AM »

Thanks for the responses.

However, if I pre-load it as a Sound I am unable to crossfade into the next music, correct?

This will be a problem when zoning into new areas as the only way I know how to crossfade is through using PlayMusicChannel().

He is very violent and is in the possession of a wide variety of arms. The harsh life of a game developer.
Logged

metamorphium

  • Global Moderator
  • Addicted to WME forum
  • *
  • Karma: 12
  • Offline Offline
  • Gender: Male
  • Posts: 1511
  • Vampires!
    • View Profile
    • CBE  software s.r.o.
Re: Sound looping without annoying cut
« Reply #5 on: May 06, 2010, 02:01:22 PM »

well, crossfade is nothing else than decreasing volume of one sound while increasing the volume of the other sound at the same time. So if you eg. have 2 global entities with preloaded sounds, you can do crossfade this way:

Code: WME Script
  1.  
  2. method crossFade()
  3. {
  4.    for (var a=0;a<100;a=a+1)
  5.    {
  6.       sndEntity1.SetSoundVolume(100-a);
  7.       sndEntity2.SetSoundVolume(a);
  8.       Sleep(10);
  9.    }
  10. }
  11.  

if you place this into game.script, you can simply call Game.crossFade();
or am I missing something?

Logged
J.U.L.I.A. Enhanced Edition, Vampires!, J.U.L.I.A., J.U.L.I.A. Untold, Ghost in the Sheet

Mnemonic

  • WME developer
  • Administrator
  • Addicted to WME forum
  • *
  • Karma: 41
  • Offline Offline
  • Gender: Male
  • Posts: 5683
    • View Profile
    • Dead:Code Site
Re: Sound looping without annoying cut
« Reply #6 on: May 09, 2010, 09:36:48 PM »

In any case, there shouldn't be any cuts in looping music. Make sure the cut is not part of the sound file.
Logged
Yes, I do have a twitter account
Please don't send me technical questions in private messages, use the forum. ::wave

Mez

  • Lurker
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 6
    • View Profile
Re: Sound looping without annoying cut
« Reply #7 on: May 21, 2010, 02:07:41 PM »

Yeah, it wasn't a fault in the engine, as long as you make perfect looping songs it's not a problem.
Thanks for the help anyways!
Logged
 

Page created in 0.046 seconds with 25 queries.