D
Dirk Reske
Hello,
I have following sourcecode:
[DllImport("msacm32.dll", CharSet=CharSet.Unicode)]
private static extern int acmStreamOpen(ref int phas,int
had,MPEGLAYER3WAVEFORMAT pwfxSrc,WAVEFORMATEX pwfxDest,WAVEFILTER pwFltr,int
callBack,int dwInstance,int dwOpen);
WAVEFORMATEX waveFormat = new WAVEFORMATEX();
waveFormat.wFormatTag = WAVE_FORMAT_PCM;
waveFormat.nChannels = 2;
waveFormat.nSamplesPerSec = 44100;
waveFormat.wBitsPerSample = 16;
waveFormat.nBlockAlign = 4;
waveFormat.nAvgBytesPerSec = 4*44100;
waveFormat.cbSize = 0;
MPEGLAYER3WAVEFORMAT mp3Format = new MPEGLAYER3WAVEFORMAT();
mp3Format.wfx = new WAVEFORMATEX();
mp3Format.wfx.cbSize = MPEGLAYER3_WFX_EXTRA_BYTES;
mp3Format.wfx.wFormatTag = WAVE_FORMAT_MPEGLAYER3;
mp3Format.wfx.nChannels = 2;
mp3Format.wfx.nAvgBytesPerSec = 128 * (1024/8);
mp3Format.wfx.wBitsPerSample = 0;
mp3Format.wfx.nBlockAlign = 1;
mp3Format.wfx.nSamplesPerSec = 44100;
mp3Format.fdwFlags = MPEGLAYER3_FLAG_PADDING_OFF;
mp3Format.nBlockSize = MP3_BLOCK_SIZE;
mp3Format.nFramesPerBlock = 1;
mp3Format.nCodecDelay = 1393;
mp3Format.wID = 1;
int acmStream = 0;
WAVEFILTER filter = new WAVEFILTER();
//--------------------------------------------------------------------------
-
int result = acmStreamOpen(ref acmStream, 0,mp3Format,waveFormat,
filter,0,0,0);
//HERE IS MY PROBLEM...THIS FUNCTION ALLWAYS RETURNS 11 (INVALID PARAM)
//--------------------------------------------------------------------------
-
Perhaps someone finds out, where my mistake is....
I have following sourcecode:
[DllImport("msacm32.dll", CharSet=CharSet.Unicode)]
private static extern int acmStreamOpen(ref int phas,int
had,MPEGLAYER3WAVEFORMAT pwfxSrc,WAVEFORMATEX pwfxDest,WAVEFILTER pwFltr,int
callBack,int dwInstance,int dwOpen);
WAVEFORMATEX waveFormat = new WAVEFORMATEX();
waveFormat.wFormatTag = WAVE_FORMAT_PCM;
waveFormat.nChannels = 2;
waveFormat.nSamplesPerSec = 44100;
waveFormat.wBitsPerSample = 16;
waveFormat.nBlockAlign = 4;
waveFormat.nAvgBytesPerSec = 4*44100;
waveFormat.cbSize = 0;
MPEGLAYER3WAVEFORMAT mp3Format = new MPEGLAYER3WAVEFORMAT();
mp3Format.wfx = new WAVEFORMATEX();
mp3Format.wfx.cbSize = MPEGLAYER3_WFX_EXTRA_BYTES;
mp3Format.wfx.wFormatTag = WAVE_FORMAT_MPEGLAYER3;
mp3Format.wfx.nChannels = 2;
mp3Format.wfx.nAvgBytesPerSec = 128 * (1024/8);
mp3Format.wfx.wBitsPerSample = 0;
mp3Format.wfx.nBlockAlign = 1;
mp3Format.wfx.nSamplesPerSec = 44100;
mp3Format.fdwFlags = MPEGLAYER3_FLAG_PADDING_OFF;
mp3Format.nBlockSize = MP3_BLOCK_SIZE;
mp3Format.nFramesPerBlock = 1;
mp3Format.nCodecDelay = 1393;
mp3Format.wID = 1;
int acmStream = 0;
WAVEFILTER filter = new WAVEFILTER();
//--------------------------------------------------------------------------
-
int result = acmStreamOpen(ref acmStream, 0,mp3Format,waveFormat,
filter,0,0,0);
//HERE IS MY PROBLEM...THIS FUNCTION ALLWAYS RETURNS 11 (INVALID PARAM)
//--------------------------------------------------------------------------
-
Perhaps someone finds out, where my mistake is....