Skip to content

Latest commit

 

History

History
474 lines (213 loc) · 13.5 KB

DirectSound.md

File metadata and controls

474 lines (213 loc) · 13.5 KB

directsound

Module directsound

A module encapsulating the DirectSound interfaces. See DirectSound examples

for a quick overview.

Methods

DS3DMODE_DISABLE

const directsound.DS3DMODE_DISABLE;

Processing of 3D sound is disabled. The sound seems to originate from the center of the listener's head.

DS3DMODE_HEADRELATIVE

const directsound.DS3DMODE_HEADRELATIVE;

Sound parameters (position, velocity, and orientation) are relative to the listener's parameters. In this mode, the absolute parameters of the sound are updated automatically as the listener's parameters change, so that the relative parameters remain constant.

DS3DMODE_NORMAL

const directsound.DS3DMODE_NORMAL;

Normal processing. This is the default mode.

directsound.DSBCAPS

PyDSBCAPS = DSBCAPS() Creates a new PyDSBCAPS object

DSBCAPS_CTRL3D

const directsound.DSBCAPS_CTRL3D;

The buffer is either a primary buffer or a secondary buffer that uses 3-D control. To create a primary buffer, the dwFlags member of the DSBUFFERDESC structure should include the DSBCAPS_PRIMARYBUFFER flag.

DSBCAPS_CTRLFREQUENCY

const directsound.DSBCAPS_CTRLFREQUENCY;

The buffer must have frequency control capability.

DSBCAPS_CTRLPAN

const directsound.DSBCAPS_CTRLPAN;

The buffer must have pan control capability.

DSBCAPS_CTRLPOSITIONNOTIFY

const directsound.DSBCAPS_CTRLPOSITIONNOTIFY;

The buffer must have control position notify capability.

DSBCAPS_CTRLVOLUME

const directsound.DSBCAPS_CTRLVOLUME;

The buffer must have volume control capability.

DSBCAPS_GETCURRENTPOSITION2

const directsound.DSBCAPS_GETCURRENTPOSITION2;

Indicates that IDirectSoundBuffer::GetCurrentPosition should use the new behavior of the play cursor. In DirectSound in DirectX 1, the play cursor was significantly ahead of the actual playing sound on emulated sound cards; it was directly behind the write cursor. Now, if the DSBCAPS_GETCURRENTPOSITION2 flag is specified, the application can get a more accurate play position. If this flag is not specified, the old behavior is preserved for compatibility. Note that this flag affects only emulated sound cards; if a DirectSound driver is present, the play cursor is accurate for DirectSound in all versions of DirectX.

DSBCAPS_GLOBALFOCUS

const directsound.DSBCAPS_GLOBALFOCUS;

The buffer is a global sound buffer. With this flag set, an application using DirectSound can continue to play its buffers if the user switches focus to another application, even if the new application uses DirectSound. The one exception is if you switch focus to a DirectSound application that uses the DSSCL_EXCLUSIVE or DSSCL_WRITEPRIMARY flag for its cooperative level. In this case, the global sounds from other applications will not be audible.

DSBCAPS_LOCHARDWARE

const directsound.DSBCAPS_LOCHARDWARE;

The buffer is in hardware memory and uses hardware mixing.

DSBCAPS_LOCSOFTWARE

const directsound.DSBCAPS_LOCSOFTWARE;

The buffer is in software memory and uses software mixing.

DSBCAPS_MUTE3DATMAXDISTANCE

const directsound.DSBCAPS_MUTE3DATMAXDISTANCE;

The sound is reduced to silence at the maximum distance. The buffer will stop playing when the maximum distance is exceeded, so that processor time is not wasted.

DSBCAPS_PRIMARYBUFFER

const directsound.DSBCAPS_PRIMARYBUFFER;

Indicates that the buffer is a primary sound buffer. If this value is not specified, a secondary sound buffer will be created.

DSBCAPS_STATIC

const directsound.DSBCAPS_STATIC;

Indicates that the buffer will be used for static sound data. Typically, these buffers are loaded once and played many times. These buffers are candidates for hardware memory.

DSBCAPS_STICKYFOCUS

const directsound.DSBCAPS_STICKYFOCUS;

Changes the focus behavior of the sound buffer. This flag can be specified in an IDirectSound::CreateSoundBuffer call. With this flag set, an application using DirectSound can continue to play its sticky focus buffers if the user switches to another application not using DirectSound. In this situation, the application's normal buffers are muted, but the sticky focus buffers are still audible. This is useful for nongame applications, such as movie playback (DirectShow&#153), when the user wants to hear the soundtrack while typing in Microsoft Word or Microsoft&#174 Excel, for example. However, if the user switches to another DirectSound application, all sound buffers, both normal and sticky focus, in the previous application are muted.

DSBLOCK_ENTIREBUFFER

const directsound.DSBLOCK_ENTIREBUFFER;

Unknown.

DSBLOCK_FROMWRITECURSOR

const directsound.DSBLOCK_FROMWRITECURSOR;

Locks from the current write cursor, making a call to DirectSoundBuffer.getCurrentPosition unnecessary. If this flag is specified, the start parameter is ignored. This flag is optional.

DSBPLAY_LOOPING

const directsound.DSBPLAY_LOOPING;

Once the end of the audio buffer is reached, play restarts at the beginning of the buffer. Play continues until explicitly stopped. This flag must be set when playing primary sound buffers.

DSBSTATUS_BUFFERLOST

const directsound.DSBSTATUS_BUFFERLOST;

The buffer is lost and must be restored before it can be played or locked.

DSBSTATUS_LOOPING

const directsound.DSBSTATUS_LOOPING;

The buffer is being looped. If this value is not set, the buffer will stop when it reaches the end of the sound data. Note that if this value is set, the buffer must also be playing.

DSBSTATUS_PLAYING

const directsound.DSBSTATUS_PLAYING;

The buffer is playing. If this value is not set, the buffer is stopped.

directsound.DSBUFFERDESC

PyDSBUFFERDESC = DSBUFFERDESC() Creates a new PyDSBUFFERDESC object

PyDSCAPS = DSCAPS() Creates a new PyDSCAPS object.

DSCAPS_CERTIFIED

const directsound.DSCAPS_CERTIFIED;

This driver has been tested and certified by Microsoft.

DSCAPS_CONTINUOUSRATE

const directsound.DSCAPS_CONTINUOUSRATE;

The device supports all sample rates between the dwMinSecondarySampleRate and dwMaxSecondarySampleRate member values. Typically, this means that the actual output rate will be within +/- 10 hertz (Hz) of the requested frequency.

DSCAPS_EMULDRIVER

const directsound.DSCAPS_EMULDRIVER;

The device does not have a DirectSound driver installed, so it is being emulated through the waveform-audio functions. Performance degradation should be expected.

DSCAPS_PRIMARY16BIT

const directsound.DSCAPS_PRIMARY16BIT;

The device supports primary sound buffers with 16-bit samples.

DSCAPS_PRIMARY8BIT

const directsound.DSCAPS_PRIMARY8BIT;

The device supports hardware-mixed secondary buffers with 8-bit samples.

DSCAPS_PRIMARYMONO

const directsound.DSCAPS_PRIMARYMONO;

The device supports monophonic primary buffers.

DSCAPS_PRIMARYSTEREO

const directsound.DSCAPS_PRIMARYSTEREO;

The device supports stereo primary buffers.

DSCAPS_SECONDARY16BIT

const directsound.DSCAPS_SECONDARY16BIT;

The device supports hardware-mixed secondary sound buffers with 16-bit samples.

DSCAPS_SECONDARY8BIT

const directsound.DSCAPS_SECONDARY8BIT;

The device supports hardware-mixed secondary buffers with 8-bit samples.

DSCAPS_SECONDARYMONO

const directsound.DSCAPS_SECONDARYMONO;

The device supports hardware-mixed monophonic secondary buffers.

DSCAPS_SECONDARYSTEREO

const directsound.DSCAPS_SECONDARYSTEREO;

The device supports hardware-mixed stereo secondary buffers.

directsound.DSCBCAPS

PyDSCBCAPS = DSCBCAPS() Creates a new PyDSCBCAPS object

DSCBCAPS_WAVEMAPPED

const directsound.DSCBCAPS_WAVEMAPPED;

The Win32 wave mapper will be used for formats not supported by the device.

directsound.DSCBUFFERDESC

PyDSCBUFFERDESC = DSCBUFFERDESC() Creates a new PyDSCBUFFERDESC object

directsound.DSCCAPS

PyDSCCAPS = DSCCAPS() Creates a new PyDSCCAPS object

DSCCAPS_EMULDRIVER

const directsound.DSCCAPS_EMULDRIVER;

The device does not have a DirectSound driver installed, so it is being emulated through the waveform-audio functions. Performance degradation should be expected.

DSSCL_EXCLUSIVE

const directsound.DSSCL_EXCLUSIVE;

Sets the application to the exclusive level. When it has the input focus, the application will be the only one audible (sounds from applications with the DSBCAPS_GLOBALFOCUS flag set will be muted). With this level, it also has all the privileges of the DSSCL_PRIORITY level. DirectSound will restore the hardware format, as specified by the most recent call to the DirectSoundBuffer.setFormat method, once the application gains the input focus. (Note that DirectSound will always restore the wave format, no matter what priority level is set.)

DSSCL_NORMAL

const directsound.DSSCL_NORMAL;

Sets the application to a fully cooperative status. Most applications should use this level, because it has the smoothest multitasking and resource-sharing behavior.

DSSCL_PRIORITY

const directsound.DSSCL_PRIORITY;

Sets the application to the priority level. Applications with this cooperative level can call the DirectSoundBuffer.setFormat and DirectSound.compact methods.

DSSCL_WRITEPRIMARY

const directsound.DSSCL_WRITEPRIMARY;

This is the highest priority level. The application has write access to the primary sound buffers. No secondary sound buffers in any application can be played.

DSSPEAKER_GEOMETRY_MAX

const directsound.DSSPEAKER_GEOMETRY_MAX;

The speakers are directed over an arc of 180 degrees.

DSSPEAKER_GEOMETRY_MIN

const directsound.DSSPEAKER_GEOMETRY_MIN;

The speakers are directed over an arc of 5 degrees.

DSSPEAKER_GEOMETRY_NARROW

const directsound.DSSPEAKER_GEOMETRY_NARROW;

The speakers are directed over an arc of 10 degrees.

DSSPEAKER_GEOMETRY_WIDE

const directsound.DSSPEAKER_GEOMETRY_WIDE;

The speakers are directed over an arc of 20 degrees.

DSSPEAKER_HEADPHONE

const directsound.DSSPEAKER_HEADPHONE;

The speakers are headphones.

DSSPEAKER_MONO

const directsound.DSSPEAKER_MONO;

The speakers are monaural.

DSSPEAKER_QUAD

const directsound.DSSPEAKER_QUAD;

The speakers are quadraphonic.

DSSPEAKER_STEREO

const directsound.DSSPEAKER_STEREO;

The speakers are stereo (default value).

DSSPEAKER_SURROUND

const directsound.DSSPEAKER_SURROUND;

The speakers are surround sound.

directsound.DirectSoundCaptureCreate

PyIUnknown = DirectSoundCaptureCreate(guid, unk

) Creates and initializes a new object that supports the IDirectSoundCapture interface.

Parameters

  • guid=None : PyIID

    Address of the GUID that identifies the sound device. The value of this parameter must be one of the GUIDs returned by DirectSoundCaptureEnumerate, or None for the default device.

  • unk=None : PyIUknown

    The IUnknown for COM aggregation.

directsound.DirectSoundCaptureEnumerate

list

= DirectSoundCaptureEnumerate() Enumerates DirectSoundCapture drivers installed in the system.

directsound.DirectSoundCreate

PyIUnknown = DirectSoundCreate(guid, unk

) Creates and initializes a new object that supports the IDirectSound interface.

Parameters

  • guid=None : PyIID

    Address of the GUID that identifies the sound device. The value of this parameter must be one of the GUIDs returned by DirectSoundEnumerate, or None for the default device.

  • unk=None : PyIUknown

    The IUnknown for COM aggregation.

directsound.DirectSoundEnumerate

list

= DirectSoundEnumerate() Enumerates DirectSound drivers installed in the system.