DirectShow problems

This is a discussion on DirectShow problems within the Game Programming forums, part of the General Programming Boards category; I'm having some troubles loading and playing Mp3's in DirectShow. I load the mp3 and plays it with: Code: DirectShowGraph->RenderFile(NewFileName, ...

  1. #1
    Confused Magos's Avatar
    Join Date
    Sep 2001
    Location
    Sweden
    Posts
    3,145

    DirectShow problems

    I'm having some troubles loading and playing Mp3's in DirectShow. I load the mp3 and plays it with:
    Code:
    DirectShowGraph->RenderFile(NewFileName, NULL);
    
    ...
    
    DirectShowMediaPosition->put_CurrentPosition(0);
    DirectShowMediaControl->Run();
    And stops it with:
    Code:
    DirectShowMediaControl->Stop();
    (basically, this code is a bit shortened)

    Anyway, if I load another mp3 file, instead of overwriting the old one it seems like they amplify each other. The volume gets louder each time a file is loaded.

    How do you clear what was loaded before? I checked the docs and I can't find a suitable function/method for that.

    I hope I don't have to recreate the graph object every time an mp3 is loaded...?
    MagosX.com

    Give a man a fish and you feed him for a day.
    Teach a man to fish and you feed him for a lifetime.

  2. #2
    Registered User The Dog's Avatar
    Join Date
    May 2002
    Location
    Cape Town
    Posts
    788
    After looking at this class that was written by Alan Kemp, I think that you'll need to recreate the graph everytime you load a mp3.

  3. #3
    Confused Magos's Avatar
    Join Date
    Sep 2001
    Location
    Sweden
    Posts
    3,145
    Sad...
    Anyway, I changed it so it works now. The Mp3 load is pretty rare so there is no noticable performance loss anyway.
    MagosX.com

    Give a man a fish and you feed him for a day.
    Teach a man to fish and you feed him for a lifetime.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. No clue how to make a code to solve problems!
    By ctnzn in forum C Programming
    Replies: 8
    Last Post: 10-16-2008, 03:59 AM
  2. C Pointers Problems
    By mhelal in forum C Programming
    Replies: 8
    Last Post: 01-10-2007, 06:35 AM
  3. String Manipulation problems -_-
    By Astra in forum C Programming
    Replies: 5
    Last Post: 12-13-2006, 05:48 PM
  4. DirectShow NEWBIE Tutorial Request
    By WaterNut in forum C++ Programming
    Replies: 4
    Last Post: 07-23-2006, 11:26 PM
  5. DJGPP problems
    By stormswift in forum C Programming
    Replies: 2
    Last Post: 02-26-2002, 04:35 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21