0
0

I’m attempting to mixdown some audio files to a WAV file in faster than realtime but I’m getting the following error:

FMOD error! (46) A call to a standard soundcard driver failed, which could possibly mean a bug in the driver or resources were missing or exhausted.

Doing this in realtime works fine (but slow of course). I would not expect to have any hardware dependencies if using the software playback.

I have been trying this with Jerome Jouvie’s NativeFModEx Java wrapper.

My code is:
[code:bq95px4c]
private System createMixdownSystem( boolean realtime, String filename )
{
System mixdownSystem = new System();

    ERRCHECK( FmodEx.System_Create(mixdownSystem) );

    // Write to file specified in the init call
    if (realtime)
        mixdownSystem.setOutput( FMOD_OUTPUTTYPE.FMOD_OUTPUTTYPE_WAVWRITER );
    else
        mixdownSystem.setOutput( FMOD_OUTPUTTYPE.FMOD_OUTPUTTYPE_WAVWRITER_NRT );

     if (filename != null)
     {
        // Wrap the filename string in an ObjectPointer
        ByteBuffer buffer = BufferUtils.newByteBuffer(filename.length() + 1 );

        BufferUtils.putString(buffer, filename);
        buffer.rewind();        // Must rewind to beginning of buffer

        Pointer filenamePtr = BufferUtils.createView(buffer);

        // Use FMOD_INIT_STREAM_FROM_UPDATE flag to lock stream reading with update() thread
        // to avoid skipping audio.
        //
        if (realtime)
            ERRCHECK( mixdownSystem.init(32, FMOD_INITFLAGS.FMOD_INIT_NORMAL, filenamePtr));
        else
            ERRCHECK( mixdownSystem.init(32, FMOD_INITFLAGS.FMOD_INIT_STREAM_FROM_UPDATE, filenamePtr));
     }
     else
     {
         ERRCHECK( mixdownSystem.init(32, FMOD_INITFLAGS.FMOD_INIT_NORMAL, null));
     }

    return mixdownSystem;
}

[/code:bq95px4c]

Any help would be much appreciated!

  • You must to post comments
0
0

FMOD Ex 4.02.03 don’t fix this error :
[code:1xn3jadl]FMOD error! (46) A call to a standard soundcard driver failed, which could possibly mean a bug in the driver or resources were missing or exhausted.[/code:1xn3jadl]

Here is a little more precisions.
This works :
[code:1xn3jadl] mixdownSystem.setOutput(FMOD_OUTPUTTYPE_WAVWRITER_NRT);
mixdownSystem.init(32, FMOD_INIT_STREAM_FROM_UPDATE, null);[/code:1xn3jadl]
But this not :
[code:1xn3jadl] mixdownSystem.setOutput(FMOD_OUTPUTTYPE_WAVWRITER_NRT);
mixdownSystem.init(32, FMOD_INIT_STREAM_FROM_UPDATE, filename); //Same error with FMOD_INIT_NORMAL[/code:1xn3jadl]

This seem to be a problem in FMOD_OUTPUTTYPE_WAVWRITER_NRT when passing a filename.
[u:1xn3jadl]Note :[/u:1xn3jadl]
There is no problem with FMOD_OUTPUTTYPE_WAVWRITER when a filename is passed.

Can you check this Brett ?

Thanks

  • You must to post comments
0
0

I compared fmod.h used in version 4.02.02 with the one used in the Java wrapper and they match. Interestingly, after setting the output, I call “mixdownSystem.getOutput()” which returns FMOD_OUTPUTTYPE_AUTODETECT. That explains the error message I originally received but the question is why is it not getting set correctly? It appears like the Java wrapper code is doing the right thing.

Thanks again :)

  • You must to post comments
0
0

ERRCHECK was not called in setOutput.
The error come from [i:2iwyjsr1]system->setOutput(FMOD_OUTPUTTYPE_WAVWRITER_NRT)[/i:2iwyjsr1] and not from init :
[code:2iwyjsr1]FMOD error! (53) A requested output, dsp unit type or codec was not available. [/code:2iwyjsr1]

This error is generated by the line setOutput from this C++ code (FMOD Ex 4.02.03 & WIN) :
[code:2iwyjsr1]
/*
Create a System object and initialize.
*/
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;
}

result = system->setOutput(FMOD_OUTPUTTYPE_WAVWRITER_NRT);   //error 53 here
ERRCHECK(result);

result = system->init(32, FMOD_INIT_STREAM_FROM_UPDATE, 0);
ERRCHECK(result);[/code:2iwyjsr1]

setOutputByPlugin works with the index of FMOD_OUTPUTTYPE_WAVWRITER_NRT.
But, if we want to select FMOD_OUTPUTTYPE_WAVWRITER_NRT with setOuput, it don’t works (error 53).

All the other outputs works with setOuput and this code, but [u:2iwyjsr1]NOT[/u:2iwyjsr1] WAVWRITER_NRT.
FMOD Ex don’t seem to recognize the FMOD_OUTPUTTYPE_WAVWRITER_NRT enum field.

Tell me if something is bad in the code.

[u:2iwyjsr1]Rem:[/u:2iwyjsr1] this is tested from [b:2iwyjsr1]C++[/b:2iwyjsr1], so no problem from Java side.

  • You must to post comments
0
0

Calling setOutputByPlugin() solves the problem I was having. You guys are great.

  • You must to post comments
Showing 4 results
Your Answer

Please first to submit.