0
0

I want to use 16 output channels of my RME Hammerfall HDSP MADI. Using the code as provided below produces the following error: Activating the first channel also activates channels 9, 11, 13, and 15. Activating the second channel also activates channels 10, 12, 14, and 16. Activating channels 9-16 does not work.

Any ideas? Thank you very much for your help!

Mathias

[code:2mt4v9ni]

include "api/inc/fmod.hpp"

include "api/inc/fmod_errors.h"

define CHANNELS 16

void ERRCHECK(FMOD_RESULT result)
{
if (result != FMOD_OK)
{
printf("FMOD error! (%d) %s\n", result, FMOD_ErrorString(result));
exit(-1);
}
}

int main(int argc, char *argv[])
{
FMOD::System * system;
FMOD_RESULT result;
FMOD::Sound * Sound[CHANNELS];
FMOD::Channel * Channel[CHANNELS];
int output;
int key=0;
char name[256];
unsigned int version;

printf("Create system\n");
    result = FMOD::System_Create(&system);  ERRCHECK(result);

result = system->getVersion(&version);
    ERRCHECK(result);

    if (version < FMOD_VERSION)
    {
        printf("Error!  You are using an old version of FMOD %08x.  This program requires %08x\n", version, FMOD_VERSION);
    return 0;
} 

// System settings
result = system->setOutput(FMOD_OUTPUTTYPE_ASIO);  
    ERRCHECK(result);
result = system->setSoftwareFormat(48000, FMOD_SOUND_FORMAT_MAX, 16, 16, FMOD_DSP_RESAMPLER_LINEAR);  
    ERRCHECK(result);

result = system->init(32, FMOD_INIT_NORMAL, 0); 
    ERRCHECK(result);

char* filename;
filename = "drumloop.wav";

float levels[2];
levels[0] = 0.5f;
levels[1] = 0.5f;

for (int i=0; i<CHANNELS; i++)
{
    result = system->createStream(filename, FMOD_HARDWARE | FMOD_2D, 0, &Sound[i]);
    ERRCHECK(result);
    result = system->playSound( (FMOD_CHANNELINDEX) i, Sound[i], true, &Channel[i] ); 
    ERRCHECK(result);
    result = Channel[i]->setSpeakerLevels( (FMOD_SPEAKER) i, levels, 2);
    ERRCHECK(result);
    result = Channel[i]->setVolume(0.5f);
    ERRCHECK(result);
}

result = Channel[0]->setPaused(false);
ERRCHECK(result);

    // main loop
do
{
    system->update();
    Sleep(10);
    if (kbhit())
    {
        key = getch();
    }
} while( key != 27 );

for (int i=0; i<CHANNELS; i++)
{
    result = Channel[i]->setVolume(0.0f); 
    ERRCHECK(result);
}

Sleep(100);

/*
    Shut down
*/
for (int i=0; i<CHANNELS; i++)
{
    result = Sound[i]->release(); 
    ERRCHECK(result);
}
result = system->release(); 
ERRCHECK(result);

return 0;

}
[/code:2mt4v9ni]

  • You must to post comments
Showing 0 results
Your Answer

Please first to submit.