0
0

Firstly, hello, this is my first post here ๐Ÿ˜†

I’m having a little trouble lately with cdda playback. I wrote that little mp3/cd player program and it worked just fine over the last year or so. Then I decided to update fmod to the most recent build and now the cd just does not play anymore. It gives me INVALID_PARAM when I call CreateSound() or CreateStream(). I did’t change anything in the sourcecode at all, so it must be some change that happened in fmod. Files play with no issues, only cds don’t. I checked the forums before this post, and maybe this has still something to do with the path unicode stuff that has been going on lately?

Any advise is appreciated, greetings from ger, thanks 8)

  • You must to post comments
0
0

Thank you for your reply. I found the problem. I am almost embarrassed to tell ๐Ÿ˜‰ I had two additional lines of code before playSound() which checked the openstate of _CDTrack for READY and if channel was null. That didn’t seem to work, because after deleting them it works. Putting them back in stops it from working again.

[code:1t8fzws7]
ERRCHECK(_CDtrack.getOpenState(ref openstate, ref percentbuffered, ref starving));
if (openstate == FMOD.OPENSTATE.READY && _channel == null)
{}
[/code:1t8fzws7]

I was 100% certain these were not the problem, thats why I didn’t post them in the first post … sry :roll:

  • You must to post comments
0
0

Can you post the code you use for System::createSound so we can try it here? There has been a few recent changes with the CDDA path loading stuff.

  • You must to post comments
0
0

Sure, its in C#:

[code:2rrntdz8]
...

private FMOD.System _system = null;
private FMOD.Sound _sound = null;
private FMOD.Sound _CDtrack = null;
private FMOD.Channel _channel = null;

...

//the following is actually from two functions, I think this is the important stuff though ...
//Init() :
ERRCHECK(FMOD.Factory.System_Create(ref _system));

ERRCHECK(_system.init(1, FMOD.INITFLAG.NORMAL, (IntPtr)null));

//Play(string strPath, int TrackNum) :
if (ERRCHECK(_system.createStream(strPath, FMOD.MODE.SOFTWARE | FMOD.MODE._2D | FMOD.MODE.CREATESTREAM, ref _sound)))
{
_sound.getSubSound(TrackNum – 1, ref _CDtrack);

ERRCHECK(_system.playSound(FMOD.CHANNELINDEX.FREE, _CDtrack, false, ref _channel));
}
[/code:2rrntdz8]

here is the function I use to get the cddrive letters which is basically the path that will be passed to the function above

[code:2rrntdz8]
public string[] getDrives()
{
StringBuilder dummybuilder = new StringBuilder();
StringBuilder Drive = new StringBuilder();

        int iNumDrives = 0;
        _system.getNumCDROMDrives(ref iNumDrives);

        string[] drives = new string[iNumDrives];

        for (int i = 0; i < drives.Length; i++)
        {

            _system.getCDROMDriveName(i, Drive, 3, dummybuilder, 0, dummybuilder, 0);
            drives[i] = Drive.ToString();                                              

        }
        return drives; //one of these will be the path for Play()
    }

[/code:2rrntdz8]

I hope this is what you are looking for, thanks :)

  • You must to post comments
0
0

Hmm, that code seems ok, I tried it out here.

I would suggest doing a cleanup, make sure you aren’t using mismatched headers and libs. Probably best to just download the latest API and install it fresh. Then rebuild your app with the new files.

If you are still having issues after that, maybe it’s best to help isolate the issue. For instance try doing create sound with a known drive letter string. i.e. just pass in say "D:" and see if that works for you.

  • You must to post comments
Showing 4 results
Your Answer

Please first to submit.