Microsoft DirectX 8.1 (C++) |
Retrieves a 3-D sound buffer for a player or group. You can use the methods of the 3-D sound buffer object to change the virtual 3-D position of incoming voice transmissions from the specified group or player.
HRESULT Create3DSoundBuffer( DVID dvID, LPDIRECTSOUNDBUFFER lpdsSourceBuffer, DWORD dwPriority, DWORD dwFlags, LPDIRECTSOUND3DBUFFER* lpUserBuffer );
Returns DV_OK if successful, or one of the following error values.
DVERR_ALREADYBUFFERED |
DVERR_INVALIDOBJECT |
DVERR_INVALIDPARAM |
DVERR_INVALIDPOINTER |
DVERR_NOTALLOWED |
DVERR_NOTCONNECTED |
DVERR_NOTINITIALIZED |
DVERR_OUTOFMEMORY |
DVERR_SESSIONLOST |
If the DirectPlay voice session is a mixing server session, this method fails and returns DVERR_NOTALLOWED.
Although you can access all the member functions of the 3-D sound buffer object, because the DirectPlay voice client uses the buffer to stream incoming audio, do not use the Lock, UnLock, or Play methods of the DirectSound3DBuffer object.
If the user specifies a buffer, DirectPlay uses that buffer for the player's or group's buffer. User-created buffers have the following restrictions.
If the buffer is not the right format, the method will return DVERR_INVALIDBUFFER.
The buffer must not be locked when you pass it to DirectPlay. When the buffer for the individual user is no longer required or when a player leaves the voice session, it is important to call IDirectPlayVoiceClient::Delete3DSoundBuffer to free up resources.
If the buffer or a portion of the buffer is locked when DirectPlay Voice attempts to write to it, the method will return DVERR_INVALIDBUFFER. If you lock the buffer after the method has returned, you will receive a DVMSGID_SESSIONLOST message. The hResult member of the associated structure will be set to DVERR_LOCKEDBUFFER. Subsequent method calls will return a DVERR_NOTCONNECTED error code.
Windows NT/2000/XP: Available as a redistributable for Windows 2000 and later.
Windows 98/Me: Available as a redistributable for Windows 98 and later.
Header: Declared in Dvoice.h.