Module nvwave
[hide private]
[frames] | no frames]

Module nvwave

source code

Provides a simple Python interface to playing audio using the Windows multimedia waveOut functions, as well as other useful utilities.

Classes [hide private]
  WAVEFORMATEX
  WAVEHDR
  WAVEOUTCAPS
  WavePlayer
Synchronously play a stream of audio.
Functions [hide private]
 
_winmm_errcheck(res, func, args) source code
 
_getOutputDevices() source code
[str, ...]
getOutputDeviceNames()
Obtain the names of all audio output devices on the system.
source code
str
outputDeviceIDToName(ID)
Obtain the name of an output device given its device ID.
source code
int
outputDeviceNameToID(name, useDefaultIfInvalid=False)
Obtain the device ID of an output device given its name.
source code
 
playWaveFile(fileName, async=True)
plays a specified wave file.
source code
Variables [hide private]
  winmm = windll.winmm
  HWAVEOUT = HANDLE
  LPHWAVEOUT = POINTER(HWAVEOUT)
  LPWAVEFORMATEX = POINTER(WAVEFORMATEX)
  LPWAVEHDR = POINTER(WAVEHDR)
  WHDR_DONE = 1
  WAVE_FORMAT_PCM = 1
  WAVE_MAPPER = -1
  MMSYSERR_NOERROR = 0
  CALLBACK_NULL = 0
  CALLBACK_EVENT = 0x50000
  MAXPNAMELEN = 32
  fileWavePlayer = None
hash(x)
  fileWavePlayerThread = None
hash(x)
Function Details [hide private]

getOutputDeviceNames()

source code 

Obtain the names of all audio output devices on the system.

Returns: [str, ...]
The names of all output devices on the system.

outputDeviceIDToName(ID)

source code 

Obtain the name of an output device given its device ID.

Parameters:
  • ID (int) - The device ID.
Returns: str
The device name.

outputDeviceNameToID(name, useDefaultIfInvalid=False)

source code 

Obtain the device ID of an output device given its name.

Parameters:
  • name (str) - The device name.
  • useDefaultIfInvalid - True to use the default device (wave mapper) if there is no such device, False to raise an exception.
Returns: int
The device ID.
Raises:
  • LookupError - If there is no such device and useDefaultIfInvalid is False.