Hi there,

I am writing my own DSP unit(s) to perform tempo & pitch analysis on sound, and have a strange problem.

My app has the option to play the sound whilst analysing, or analyse silently. The analysis is invoked in a function, Analyse(bool playWhile) with playWhile determining if the sound should be played (true) or not. I then (re)init the system object having set the output to play sound or not.

I then take apart the DSP chain to connect my DSP unit between the sound and the output (head).

The peculiar thing is, when I try the silent analysis, it works fine and I can see the numbers my DSP is giving me, as I want. If I try it with the sound on, it crashes when I try to disconnect the head.

I have tried playing the sound before or after the DSP connections, init’ing the system before or after, setting the units inactive before disconnecting, and starting the sound paused. No combination of these works.

Here is the current state of my code:
bool Analyse(bool playWhile)
{ inited = false; // just to be tidy
sys->close(); // kill the system so we can set output

        sys->setOutput(FMOD_OUTPUTTYPE_NOSOUND); //Silent

inited = (FMOD_OK == sys->init(8,8,FMOD_INIT_NORMAL,NULL));      
            // (re) create the sound

            // play sound
        FMOD_RESULT result;
        result = sys->playSound(

        // get dsp description
        FMOD_DSP_DESCRIPTION* desc = FMODGetDSPDescription();

        // create the unit
        sys->createDSP(desc, &dsp);

        // now to add it to the chain:
        // get head
        FMOD::DSP* head;
        FMOD::DSP* wave;

        // set head inactive

        // get input to this
        head->getInput(0, &wave);

        // set wave inactive

        // disconnect           
        head->disconnectFrom(wave); <--- dies here, only when sound is on

        // connect the wave to our dsp...
        // now connect our dsp to the head
        // now set all to active


        return (FMOD_OK==result);

Be gentle, I’m not very experienced with C/C++…

Any ideas would be much appreciated, I’m trying to get past this simple stuff so I can get onto using the cool FMOD features like syncing, looping and pitch shift ๐Ÿ˜›



  • You must to post comments

wow quick reply, thanx ๐Ÿ˜€

I was following the DSP connections based on your reply to the guy asking about tone generation so kind of making it up as I went along ๐Ÿ˜‰

Yes I am using v28.

I have discovered something more interesting. Having read [url=]the previous topic[/url:2wzy4bad], I tried changing
[code:2wzy4bad]sys->setOutput(FMOD_OUTPUTTYPE_AUTODETECT); [/code:2wzy4bad]
to use DSOUND, WINMM, and ASIO types.

WINMM works! ASIO worked too, though it played through my laptop’s internal sound card, not my external SB Audigy. ASIO probably set like that, and it’s not like my prog does anything to choose the driver yet.
DSOUND and AUTODETECT did crash the same though.

After looking at the topic on AUTODETECT I thought I’d try your logging version of the API, so I have an fmod.log if you want to take a look…

edit: mailed fmod.log to support@

  • You must to post comments
Showing 1 result