The following only summarizes information from the PyAudio Web page.
PyAudio provides Python bindings for the PortAudio audio I/O library. The current version of PyAudio is V0.1.0, which is alpha quality.
Multi-platform Package is compilable for MS-Windows, Apple Mac OS X, Linux and cygwin. Real-time sound acquisition Unknown Support for 16KHz sampling rate and >8-bit sound Unknown. Sound file processing Unknown. Efficiency Unknown. Pitch existence and frequency Unknown. Formants and their bandwidths Unknown. FFT with pre-emphasis and Hamming window Unknown. Power Unknown.
Multi-platform Package is compilable for MS-Windows, Linux and cygwin. Real-time sound acquisition Unknown Support for 16KHz sampling rate and >8-bit sound Probably depends upon sound card. Sound file processing Yes. Efficiency Unknown. Pitch existence and frequency Use another package for this. Formants and their bandwidths Use another package for this. FFT with pre-emphasis and Hamming window Use another package for this. Power Use another package for this.
Multi-platform ctypes.py is supported by all 32-bit MS Windows (95/98/NT/2000/XP), All BSD Platforms (FreeBSD/NetBSD/OpenBSD/Apple Mac OS X), All POSIX (Linux/BSD/UNIX-like OSes), WinCE. MCI.py was designed to communicate with MS-Windows winmm.dll. Real-time sound acquisition Unknown. Support for 16KHz sampling rate and >8-bit sound Unknown. Sound file processing Seems to be able to record to a file. Efficiency Commands are sent as strings. Pitch existence and frequency Use another package for this. Formants and their bandwidths Use another package for this. FFT with pre-emphasis and Hamming window Use another package for this. Power Use another package for this.
Multi-platform Not enough. Implemented in Linux and FreeBSD. Available for a wide range of open-source and commercial Unices. But apparently not for MS-Windows. Real-time sound acquisition Blocking reads, by default. Probably can set to non-blocking. Support for 16KHz sampling rate and >8-bit sound Seems to depend upon the sound card. Sound file processing Use another package for this. Efficiency Direct I/O access. Pitch existence and frequency Use another package for this. Formants and their bandwidths Use another package for this. FFT with pre-emphasis and Hamming window Use another package for this. Power Use another package for this.
Multi-platform The same scripts are usable on Windows 95/98/NT/2K/XP, Linux, Macintosh, Sun Solaris, HP-UX, FreeBSD, NetBSD, and SGI IRIX. Real-time sound acquisition Yes. Support for 16KHz sampling rate and >8-bit sound Yes. Sound file processing Yes. Efficiency Inefficient - data is converted into string by the Tcl part of the package and then converted back into data by the Python part. Pitch existence and frequency Yes. Each 10mSec, using the ESPS method (the ADMF method is available, too). Formants and their bandwidths www.speech.kth.se/snack/man/snack2.2/tcl-man.html#sound - see the formant subcommand. FFT with pre-emphasis and Hamming window See above link - the powerSpectrum subcommand. Power See above link - the power subcommand.
#!/usr/bin/env python # -*- coding: utf-8 -*- import sys, os, stat import time
def main(root): dirsize = {} for dirpath, dirnames, filenames in os.walk(root, topdown=False): dirsize[dirpath] = 0 for file in filenames: tgt = os.path.join(dirpath, file) siz = os.stat(tgt)[stat.ST_SIZE] dirsize[dirpath] += siz for dir in dirnames: tgt = os.path.join(dirpath, dir) siz = dirsize[tgt] dirsize[dirpath] += siz print '"dir","%s",%d' % (tgt, siz)
print '"total","%s",%d' % (root, dirsize[root])
if __name__ == '__main__': if len(sys.argv) >= 2: main(sys.argv[1])
#!/usr/bin/env python # -*- coding: utf-8 -*- import sys, os, stat import time
def main(root): dirsize = {} for dirpath, dirnames, filenames in os.walk(rootroot.decode('cp932'), topdown=False): dirsize[dirpath] = 0 for file in filenames: tgt = os.path.join(dirpath, file) siz = os.stat(tgt)[stat.ST_SIZE] dirsize[dirpath] += siz for dir in dirnames: tgt = os.path.join(dirpath, dir) siz = dirsize[tgt] dirsize[dirpath] += siz print '"dir","%s",%d' % (tgt, siz)
print '"total","%s",%d' % (root, dirsize[root])
if __name__ == '__main__': if len(sys.argv) >= 2: main(sys.argv[1])
#!/usr/bin/env python # -*- coding: utf-8 -*- import sys, os, stat import time
def main(root): dirsize = {} for dirpath, dirnames, filenames in os.walk(root.decode('cp932'), topdown=False): dirsize[dirpath] = 0 for file in filenames: tgt = os.path.join(dirpath, file) siz = os.stat(tgt)[stat.ST_SIZE] dirsize[dirpath] += siz for dir in dirnames: tgt = os.path.join(dirpath, dir) siz = dirsize[tgt] dirsize[dirpath] += siz print u'"dir","%s",%d' % (tgt, siz)
print u'"total","%s",%d' % (root, dirsize[root])
if __name__ == '__main__': if len(sys.argv) >= 2: main(sys.argv[1])