User Tag List

Page 1 of 2 1 2 LastLast
Results 1 to 10 of 11

Thread: Play sound IMMEDIATELY after other sound finishes

  1. #1
    No Products Registered

    Join Date
    Jul 2006
    Location
    Texas
    Posts
    1,225
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Play sound IMMEDIATELY after other sound finishes

    Hi, I have a song for my game, and I have it broken up into 2 chunks, 1 for the intro (which will play once), then once that one is done playing, the next one plays in a loop.

    The problem I'm having is I'm doing something like 'Music#1 is NOT playing', play music#2. Problem is that there's a bit of a pause between the music being played. I'm guessing it's at 1/65th of a second (the game is set to run at 65 fps).

    Is there any way to get it to run the event the instant the sound finishes?

  2. #2
    No Products Registered

    Join Date
    Dec 2006
    Posts
    1,332
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Play sound IMMEDIATELY after other sound finis

    If your using Direct Show, you can probably compare the total time with the current time and when the first track has a couple milliseconds left, go to the next track. If your using audio player built into MMF2 and your audio is in the start up screen, you can speed up the frame rate so that the pause is even faster.

  3. #3
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleSWF Export ModuleInstall Creator ProPatch Maker
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Fusion 2.5+ DLC (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)
    DJFuego's Avatar
    Join Date
    Jul 2006
    Location
    UK
    Posts
    1,410
    Mentioned
    4 Post(s)
    Tagged
    0 Thread(s)

    Re: Play sound IMMEDIATELY after other sound finis

    it's not quick enough. This is a hit and miss area that is affected by multiple codecs being installed. If you have FFDshow for instance and it's configured to resample, filter any audio, then you'll have issues with getting a quick responce.

  4. #4
    Clicker Multimedia Fusion 2 DeveloperiOS Export Module

    Join Date
    Jun 2006
    Posts
    375
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Play sound IMMEDIATELY after other sound finis

    Are you using music (MIDI) or samples (the rest)? If a sample, it'd be best to use 2 channels. If music, then I'm clueless.

  5. #5
    No Products Registered

    Join Date
    Jul 2006
    Location
    Texas
    Posts
    1,225
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Play sound IMMEDIATELY after other sound finis

    I'm using OGG files and I'm playing them with the built in 'sound object' that is always there.

    Use 2 channels? How would that make a difference?

  6. #6
    Clicker Multimedia Fusion 2 DeveloperiOS Export Module

    Join Date
    Jun 2006
    Posts
    375
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Play sound IMMEDIATELY after other sound finis

    It will require some precise sound editing.
    But the technique is to play both samples the same time in 2 separate channels and muting the loop version. Once the intro has stopped, you raise the volume of the other channel.

    But like I said, it'll require some editing to the sound.

  7. #7
    No Products Registered

    Join Date
    Dec 2006
    Posts
    1,332
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Play sound IMMEDIATELY after other sound finis

    A very simple and somewhat primitive solution would be to make it one file and just have the second part of the music repeating in the sound file, so that all you have to do is play the whole file and it will keep playing through. This wouldn't work if your game takes a long time because the sound file would have to be huge. You will obviously need sound editing software like Audacity to combined the tracks and loop the second one.

  8. #8
    No Products Registered

    Join Date
    Jul 2006
    Location
    Texas
    Posts
    1,225
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Play sound IMMEDIATELY after other sound finis

    Quote Originally Posted by MetalGeo
    It will require some precise sound editing.
    But the technique is to play both samples the same time in 2 separate channels and muting the loop version. Once the intro has stopped, you raise the volume of the other channel.

    But like I said, it'll require some editing to the sound.
    The intro and the loop are not the same length. The intro is shorter than the loop.

    Quote Originally Posted by Brandon
    A very simple and somewhat primitive solution would be to make it one file and just have the second part of the music repeating in the sound file, so that all you have to do is play the whole file and it will keep playing through. This wouldn't work if your game takes a long time because the sound file would have to be huge. You will obviously need sound editing software like Audacity to combined the tracks and loop the second one.
    I would like it to repeat infinitely, not just the number of times it loops inside the sound file. That would take up too much space anyways.

    The only thing I would need to do this is a true event like 'sound finishes playing'.

  9. #9
    Clicker Multimedia Fusion 2 DeveloperiOS Export Module

    Join Date
    Jun 2006
    Posts
    375
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Play sound IMMEDIATELY after other sound finis

    Quote Originally Posted by LazyCoder
    The intro and the loop are not the same length. The intro is shorter than the loop.
    That's what I meant with editing, silly.

    The loop will have to be twice as long, but that shouldn't be a problem. Easily edited in tools like Goldwave. Just going to need to edit the begin and the end of the loop.

    Honestly, it's much easier than it sounds.

    Edit: I made a visual tutorial.


    Keep in mind though. If the intro is longer than the original loop, it's merely a different step. But still basically the same.

    Hope this helps.

  10. #10
    Clicker Fusion 2.5 DeveloperFusion 2.5+ DLCSWF Export Module
    Alonso's Avatar
    Join Date
    Jul 2006
    Posts
    681
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Play sound IMMEDIATELY after other sound finis

    The way I did it was have all the game's music in one huge ogg and when I want a song to loop, I simply change the position of the sound file. It's really easy, actually.

Page 1 of 2 1 2 LastLast

Similar Threads

  1. How do you play default ios sound, eg the notification sound.
    By assentec in forum iOS Export Module Version 2.0
    Replies: 2
    Last Post: 14th July 2013, 06:33 AM
  2. How do I play a sound then go to another frame?
    By Keith in forum Multimedia Fusion 2 - Technical Support
    Replies: 2
    Last Post: 8th August 2011, 09:02 PM
  3. How to play a sound once while over object
    By Selveria in forum Multimedia Fusion 2 - Technical Support
    Replies: 4
    Last Post: 8th May 2010, 06:49 PM
  4. [Request]When Sound Finishes Event
    By LazyCoder in forum Multimedia Fusion 2 - Technical Support
    Replies: 0
    Last Post: 1st September 2007, 12:20 AM
  5. Sound samples don't play in exe
    By BenMo in forum Multimedia Fusion 2 - Technical Support
    Replies: 5
    Last Post: 23rd January 2007, 02:18 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •