Results 1 to 3 of 3

Thread: Need help with Managed DirectX [SOLVED]

  1. #1

    Thread Starter
    Member
    Join Date
    Nov 2002
    Location
    Netherlands
    Posts
    32

    Question Need help with Managed DirectX [SOLVED]

    Can someone please help me with this:

    I've recently downloaded DirectX 9 SDK, with the new manged directx feature.

    Now I'm building a MP3 player program and using the Audio class of the DirectX.AudioVideoPlayblack namespace.

    The Audio class is a great class to play MP3 files. You can do this like this:
    Code:
    Public WithEvents audio As Microsoft.DirectX.AudioVideoPlayback.Audio
    
    Public Sub PlaySong(MP3FileName)
      audio = audio.FromURL(MP3FileName)
      audio.Play()
    End Sub
    And do this everytime the user clicks the play-button.

    The problem is, that this audio object just grows and grows as it does not close the files it opened with the FromURL() method.

    The class has no method Close() or something and there is no property to determine the filenumber.

    Please help me!!!
    Last edited by M@rtyn12345; Mar 18th, 2003 at 04:40 AM.

  2. #2
    yay gay PT Exorcist's Avatar
    Join Date
    Apr 2002
    Location
    . . . my reason of shame
    Posts
    2,729
    try setting it to nothing or something like that :\
    \m/\m/

  3. #3

    Thread Starter
    Member
    Join Date
    Nov 2002
    Location
    Netherlands
    Posts
    32
    Thanks, but I already figured out what the problem was.

    When I wanted to load a new file, I used the FromURL() method, but this returned a new audio object and keeps the old in memory.

    The FromURL() or FromFile() methods, should be called once, to create one audio object. If you want to load a new file (with that single audio object) you have to use the OpenURL() or OpenFile() method.

Posting Permissions

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



Click Here to Expand Forum to Full Width