Playing sounds causes unwanted pauses

Discussion in 'Microsoft Dot NET Compact Framework' started by Dom, Jul 15, 2003.

  1. Dom

    Dom Guest

    I'm playing sounds from memory but they're causing my game's graphics to
    pause. Does anybody know how to get around this ?
    Thanks,
    Dom
     
    Dom, Jul 15, 2003
    #1
    1. Advertisements

  2. Are you playing the sounds on a separate thread?

    --
    Chris Tacke, eMVP
    Advisory Board Member
    www.OpenNETCF.org
    ---
    Windows CE Product Manager
    Applied Data Systems
    www.applieddata.net


    "Dom" <> wrote in message
    news:%23%...
    > I'm playing sounds from memory but they're causing my game's graphics to
    > pause. Does anybody know how to get around this ?
    > Thanks,
    > Dom
    >
    >
     
    Chris Tacke, eMVP, Jul 15, 2003
    #2
    1. Advertisements

  3. Are you playing it asynchronously using something like:

    PlaySound(bstr, IntPtr.Zero, SND_ASYNC Or SND_MEMORY)

    Or are you still getting the delay doing it this way?
    Steven

    "Dom" <> wrote in message
    news:...
    > As ever you are a shining light Chris ! I take it using threads will cure
    > the issue ? That is fantastic.
    > Thanks,
    > Dom
    > "Chris Tacke, eMVP" <> wrote in message
    > news:#...
    > > Are you playing the sounds on a separate thread?
    > >
    > > --
    > > Chris Tacke, eMVP
    > > Advisory Board Member
    > > www.OpenNETCF.org
    > > ---
    > > Windows CE Product Manager
    > > Applied Data Systems
    > > www.applieddata.net
    > >
    > >
    > > "Dom" <> wrote in message
    > > news:%23%...
    > > > I'm playing sounds from memory but they're causing my game's graphics

    to
    > > > pause. Does anybody know how to get around this ?
    > > > Thanks,
    > > > Dom
    > > >
    > > >

    > >
    > >

    >
    >
     
    Steven Licciardi, Jul 15, 2003
    #3
  4. Dom

    Henrik Dahl Guest

    Dom,

    Try to initiate the garbage collector just before, so it will not succeed in
    anything while this is going on.


    Best regards,

    Henrik Dahl

    "Dom" <> wrote in message
    news:...
    > Hello Steven,
    > Yep that is identical to my Play Sound command. Also I tried threading but
    > with no luck. It is only a small delay when a sound is played but it is
    > noticeable and makes it look extremely amateurish. Any other ideas

    welcome.
    > Thanks,
    > Dom
    > "Steven Licciardi" <> wrote in
    > message news:...
    > > Are you playing it asynchronously using something like:
    > >
    > > PlaySound(bstr, IntPtr.Zero, SND_ASYNC Or SND_MEMORY)
    > >
    > > Or are you still getting the delay doing it this way?
    > > Steven
    > >
    > > "Dom" <> wrote in message
    > > news:...
    > > > As ever you are a shining light Chris ! I take it using threads will

    > cure
    > > > the issue ? That is fantastic.
    > > > Thanks,
    > > > Dom
    > > > "Chris Tacke, eMVP" <> wrote in message
    > > > news:#...
    > > > > Are you playing the sounds on a separate thread?
    > > > >
    > > > > --
    > > > > Chris Tacke, eMVP
    > > > > Advisory Board Member
    > > > > www.OpenNETCF.org
    > > > > ---
    > > > > Windows CE Product Manager
    > > > > Applied Data Systems
    > > > > www.applieddata.net
    > > > >
    > > > >
    > > > > "Dom" <> wrote in message
    > > > > news:%23%...
    > > > > > I'm playing sounds from memory but they're causing my game's

    > graphics
    > > to
    > > > > > pause. Does anybody know how to get around this ?
    > > > > > Thanks,
    > > > > > Dom
    > > > > >
    > > > > >
    > > > >
    > > > >
    > > >
    > > >

    > >
    > >

    >
    >
     
    Henrik Dahl, Jul 15, 2003
    #4
  5. Dom

    Henrik Dahl Guest

    OK,

    In the full framework you may give the time to some other thread, as far as
    I remember it's by Thread.Sleep(0). What if you do this just before you
    play?


    Best regards,

    Henrik Dahl

    "Dom" <> wrote in message
    news:%23rI$...
    > Sadly no luck Henrik. It's as smooth as anything so long as I don't use
    > sounds :0(
    > Dom
    >
    > "Henrik Dahl" <2.dk> wrote in message
    > news:u3#...
    > > Dom,
    > >
    > > Try to initiate the garbage collector just before, so it will not

    succeed
    > in
    > > anything while this is going on.
    > >
    > >
    > > Best regards,
    > >
    > > Henrik Dahl
    > >
    > > "Dom" <> wrote in message
    > > news:...
    > > > Hello Steven,
    > > > Yep that is identical to my Play Sound command. Also I tried threading

    > but
    > > > with no luck. It is only a small delay when a sound is played but it

    is
    > > > noticeable and makes it look extremely amateurish. Any other ideas

    > > welcome.
    > > > Thanks,
    > > > Dom
    > > > "Steven Licciardi" <> wrote in
    > > > message news:...
    > > > > Are you playing it asynchronously using something like:
    > > > >
    > > > > PlaySound(bstr, IntPtr.Zero, SND_ASYNC Or SND_MEMORY)
    > > > >
    > > > > Or are you still getting the delay doing it this way?
    > > > > Steven
    > > > >
    > > > > "Dom" <> wrote in message
    > > > > news:...
    > > > > > As ever you are a shining light Chris ! I take it using threads

    will
    > > > cure
    > > > > > the issue ? That is fantastic.
    > > > > > Thanks,
    > > > > > Dom
    > > > > > "Chris Tacke, eMVP" <> wrote in

    message
    > > > > > news:#...
    > > > > > > Are you playing the sounds on a separate thread?
    > > > > > >
    > > > > > > --
    > > > > > > Chris Tacke, eMVP
    > > > > > > Advisory Board Member
    > > > > > > www.OpenNETCF.org
    > > > > > > ---
    > > > > > > Windows CE Product Manager
    > > > > > > Applied Data Systems
    > > > > > > www.applieddata.net
    > > > > > >
    > > > > > >
    > > > > > > "Dom" <> wrote in message
    > > > > > > news:%23%...
    > > > > > > > I'm playing sounds from memory but they're causing my game's
    > > > graphics
    > > > > to
    > > > > > > > pause. Does anybody know how to get around this ?
    > > > > > > > Thanks,
    > > > > > > > Dom
    > > > > > > >
    > > > > > > >
    > > > > > >
    > > > > > >
    > > > > >
    > > > > >
    > > > >
    > > > >
    > > >
    > > >

    > >
    > >

    >
    >
     
    Henrik Dahl, Jul 15, 2003
    #5
  6. Dom

    SeanC Guest

    I have a freeware sound library on my site (www.intuitex.com) that I use
    in my game. No noticable pauses when playing sounds. Plays/mixes waves
    and mod files.

    Regards

    Sean
    ---------------------------------------
    Sean Cross
    mailto:

    Pics Print - The photo printing solution for Windows.
    http://www.picsprint.com

    http://www.Intuitex.com -
    Multimedia software for Windows
    Game libraries for the dot net compact framework
     
    SeanC, Jul 15, 2003
    #6
    1. Advertisements

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. garrick

    Playing built in sounds

    garrick, Dec 6, 2003, in forum: Microsoft Dot NET Compact Framework
    Replies:
    1
    Views:
    177
    Peter Foot [MVP]
    Dec 6, 2003
  2. Brian

    Threading issue w/ sounds

    Brian, Dec 27, 2003, in forum: Microsoft Dot NET Compact Framework
    Replies:
    0
    Views:
    164
    Brian
    Dec 27, 2003
  3. Guest

    System Beep sounds

    Guest, Aug 10, 2004, in forum: Microsoft Dot NET Compact Framework
    Replies:
    1
    Views:
    263
    Guest
    Aug 10, 2004
  4. Geoff Callaghan

    Playing/stopping sounds

    Geoff Callaghan, Jul 8, 2005, in forum: Microsoft Dot NET Compact Framework
    Replies:
    4
    Views:
    261
    Geoff Callaghan
    Jul 12, 2005
  5. mcm

    Timer-based Animation with g.DrawImage Gives Random Pauses

    mcm, Jul 8, 2008, in forum: Microsoft Dot NET Compact Framework
    Replies:
    5
    Views:
    367
    Chris Tacke, MVP
    Jul 10, 2008
Loading...

Share This Page