locked
Error : Audio.play does not release a Windows handle RRS feed

  • Question

  • I repeateadly call

    My

     

    .Computer.Audio.Play(wavPath)

    to play small wav files. The Windows Handle count for my app increases each time Play is called until the app eventually crashes with

    "The current process has used all of its system allowance of handles for Windows Manager objects"

    Is there a bypass for this error?

    Monday, November 29, 2010 12:49 PM

Answers

  • Using SoundPlayer explicitly gets round the problem...

    dim wavPlayer as new system.media.soundplayer [do this once]

    wavPlayer.SoundLocation = wavPath

    wavPlayer.Play()

     

     

     

     

    • Marked as answer by Cookie Luo Thursday, December 2, 2010 3:07 AM
    Wednesday, December 1, 2010 7:53 PM

All replies

  • Using SoundPlayer explicitly gets round the problem...

    dim wavPlayer as new system.media.soundplayer [do this once]

    wavPlayer.SoundLocation = wavPath

    wavPlayer.Play()

     

     

     

     

    • Marked as answer by Cookie Luo Thursday, December 2, 2010 3:07 AM
    Wednesday, December 1, 2010 7:53 PM
  • Hi Ilens

    Thanks for sharing your answer. Welcome to MSDN next time.

    Best Regards,

     


    Please mark the right answers which satisfy your requirements.That will be helpfull for all community members. Thanks, Cookie
    Thursday, December 2, 2010 3:07 AM