raw audio in windows
Jay
jaysherby at gmail.com
Fri Sep 1 13:33:19 EDT 2006
So, are you saying this would be possible to do with the PlaySound
function?
Fredrik Lundh wrote:
> Ben Sizer wrote:
>
> > Not really. You'll have to convert it to .wav and then pass it to a
> > helper app.
> >
> > <http://www.microsoft.com/technet/scriptcenter/resources/qanda/nov04/hey1103.mspx>
>
> >>> import winsound
> >>> help(winsound)
> Help on module winsound:
>
> NAME
> winsound
>
> FILE
> c:\python24\dlls\winsound.pyd
>
> DESCRIPTION
> PlaySound(sound, flags) - play a sound
> SND_FILENAME - sound is a wav file name
> SND_ALIAS - sound is a registry sound association name
> SND_LOOP - Play the sound repeatedly; must also specify SND_ASYNC
> SND_MEMORY - sound is a memory image of a wav file
> SND_PURGE - stop all instances of the specified sound
> SND_ASYNC - PlaySound returns immediately
> SND_NODEFAULT - Do not play a default beep if the sound can not be found
> SND_NOSTOP - Do not interrupt any sounds currently playing
> SND_NOWAIT - Return immediately if the sound driver is busy
>
> Beep(frequency, duration) - Make a beep through the PC speaker.
>
> FUNCTIONS
> Beep(...)
> Beep(frequency, duration) - a wrapper around the Windows Beep API
>
> The frequency argument specifies frequency, in hertz, of the sound.
> This parameter must be in the range 37 through 32,767.
> The duration argument specifies the number of milliseconds.
> On WinNT and 2000, the platform Beep API is used directly. Else funky
> code doing direct port manipulation is used; it's unknown whether that
> will work on all systems.
>
> MessageBeep(...)
> MessageBeep(x) - call Windows MessageBeep(x). x defaults to MB_OK.
>
> PlaySound(...)
> PlaySound(sound, flags) - a wrapper around the Windows PlaySound API
>
> The sound argument can be a filename, data, or None.
> For flag values, ored together, see module documentation.
>
> DATA
> MB_ICONASTERISK = 64L
> MB_ICONEXCLAMATION = 48L
> MB_ICONHAND = 16L
> MB_ICONQUESTION = 32L
> MB_OK = 0L
> SND_ALIAS = 65536L
> SND_APPLICATION = 128L
> SND_ASYNC = 1L
> SND_FILENAME = 131072L
> SND_LOOP = 8L
> SND_MEMORY = 4L
> SND_NODEFAULT = 2L
> SND_NOSTOP = 16L
> SND_NOWAIT = 8192L
> SND_PURGE = 64L
>
> </F>
More information about the Python-list
mailing list