A module encapsulating the DirectSound interfaces. See DirectSound examples
for a quick overview.
-
Creates and initializes a new object that supports the IDirectSound interface.
-
The DirectSoundEnumerate function enumerates the DirectSound drivers installed in the system.
-
The DirectSoundCaptureCreate function creates and initializes an object that supports the IDirectSoundCapture interface.
-
The DirectSoundCaptureEnumerate function enumerates the DirectSoundCapture objects installed in the system.
-
Creates a new PyDSCAPS object.
-
Creates a new PyDSBCAPS object.
-
Creates a new PyDSCCAPS object.
-
Creates a new PyDSCBCAPS object.
-
Creates a new PyDSBUFFERDESC object.
-
Creates a new PyDSCBUFFERDESC object.
const directsound.DS3DMODE_DISABLE;
Processing of 3D sound is disabled. The sound seems to originate from the center of the listener's head.
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.
const directsound.DS3DMODE_NORMAL;
Normal processing. This is the default mode.
directsound.DSBCAPS
PyDSBCAPS = DSBCAPS() Creates a new PyDSBCAPS object
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.
const directsound.DSBCAPS_CTRLFREQUENCY;
The buffer must have frequency control capability.
const directsound.DSBCAPS_CTRLPAN;
The buffer must have pan control capability.
const directsound.DSBCAPS_CTRLPOSITIONNOTIFY;
The buffer must have control position notify capability.
const directsound.DSBCAPS_CTRLVOLUME;
The buffer must have volume control capability.
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.
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.
const directsound.DSBCAPS_LOCHARDWARE;
The buffer is in hardware memory and uses hardware mixing.
const directsound.DSBCAPS_LOCSOFTWARE;
The buffer is in software memory and uses software mixing.
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.
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.
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.
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™), when the user wants to hear the soundtrack while typing in Microsoft Word or Microsoft® 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.
const directsound.DSBLOCK_ENTIREBUFFER;
Unknown.
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.
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.
const directsound.DSBSTATUS_BUFFERLOST;
The buffer is lost and must be restored before it can be played or locked.
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.
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
directsound.DSCAPS
PyDSCAPS = DSCAPS() Creates a new PyDSCAPS object.
const directsound.DSCAPS_CERTIFIED;
This driver has been tested and certified by Microsoft.
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.
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.
const directsound.DSCAPS_PRIMARY16BIT;
The device supports primary sound buffers with 16-bit samples.
const directsound.DSCAPS_PRIMARY8BIT;
The device supports hardware-mixed secondary buffers with 8-bit samples.
const directsound.DSCAPS_PRIMARYMONO;
The device supports monophonic primary buffers.
const directsound.DSCAPS_PRIMARYSTEREO;
The device supports stereo primary buffers.
const directsound.DSCAPS_SECONDARY16BIT;
The device supports hardware-mixed secondary sound buffers with 16-bit samples.
const directsound.DSCAPS_SECONDARY8BIT;
The device supports hardware-mixed secondary buffers with 8-bit samples.
const directsound.DSCAPS_SECONDARYMONO;
The device supports hardware-mixed monophonic secondary buffers.
const directsound.DSCAPS_SECONDARYSTEREO;
The device supports hardware-mixed stereo secondary buffers.
directsound.DSCBCAPS
PyDSCBCAPS = DSCBCAPS() Creates a new PyDSCBCAPS object
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
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.
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.)
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.
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.
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.
const directsound.DSSPEAKER_GEOMETRY_MAX;
The speakers are directed over an arc of 180 degrees.
const directsound.DSSPEAKER_GEOMETRY_MIN;
The speakers are directed over an arc of 5 degrees.
const directsound.DSSPEAKER_GEOMETRY_NARROW;
The speakers are directed over an arc of 10 degrees.
const directsound.DSSPEAKER_GEOMETRY_WIDE;
The speakers are directed over an arc of 20 degrees.
const directsound.DSSPEAKER_HEADPHONE;
The speakers are headphones.
const directsound.DSSPEAKER_MONO;
The speakers are monaural.
const directsound.DSSPEAKER_QUAD;
The speakers are quadraphonic.
const directsound.DSSPEAKER_STEREO;
The speakers are stereo (default value).
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.
-
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.
-
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.