Hello,
I'm trying to play sound from a C program using DirectSound ( Secondary
Buffer ) and I'm getting an error:
109 dxsound.c structure has no member named `CreateSoundBuffer'
piece of code is:
#include <windows.h>
#include <mmsystem.h>
#include <dsound.h>
[...]
IDirectSound pds; /* DirectSound object */
IDirectSoundBuffer pdsbuffer; /* sound buffer */
/* initialization of DirectSound, CooperativeLevel etc. */
/* create wave format description */
memset( &pcmwf, 0, sizeof( WAVEFORMATEX ) );
/* filling the values */
/* create sound buffer description */
memset( &dsbd, 0, sizeof( DSBUFFERDESC ) );
/* filling the values */
IDirectSound_CreateSoundBuffer( &pdsbuffer, &dsbd, &pdsbuffer, NULL );
does anyone know the solution to this? I can send the entire unit if needed.
Also when I tried to compile I was getting duplicate definition errors between
dsound.h and mmsystem.h.
The changes I had to make were:
in mmsystem.h
line 1008:
change
#ifndef _WAVEFORMATEX_
#define _WAVEFORMATEX_
to:
#ifndef _WAVEFORMATEX_
#define _WAVEFORMATEX_
#define _LPCWAVEFORMATEX_DEFINED
in dsound.h
line 1899:
change:
typedef struct IDirectSoundFullDuplex *LPDIRECTSOUNDFULLDUPLEX;
to:
//typedef struct IDirectSoundFullDuplex *LPDIRECTSOUNDFULLDUPLEX;
Am I missing something?
Thanks in advance,
Marek
|