Пример #1
0
    def get_host_api_info_by_index(self, host_api_index):
        """
        Return a dictionary containing the Host API parameters for the
        host API specified by the `host_api_index`. The keys of the
        dictionary mirror the data fields of PortAudio's ``PaHostApiInfo``
        structure.

        :param host_api_index: The host api index
        :raises IOError: for invalid `host_api_index`
        :rtype: dict
        """

        return self._make_host_api_dictionary(
            host_api_index, pa.get_host_api_info(host_api_index))
Пример #2
0
    def get_host_api_info_by_index(self, host_api_index):
        """
        Return a dictionary containing the Host API parameters for the
        host API specified by the `host_api_index`. The keys of the
        dictionary mirror the data fields of PortAudio's ``PaHostApiInfo``
        structure.

        :param host_api_index: The host api index
        :raises IOError: for invalid `host_api_index`
        :rtype: dict
        """

        return self._make_host_api_dictionary(
            host_api_index,
            pa.get_host_api_info(host_api_index)
            )
Пример #3
0
import _portaudio as p

p.initialize()
max_apis = p.get_host_api_count()
max_devs = p.get_device_count()

print "\nPortAudio System Info:\n======================"
print "Version: %d" % p.get_version()
print "Version Text: %s" % p.get_version_text()
print "Number of Host APIs: %d" % max_apis
print "Number of Devices  : %d" % max_devs

print "\nHost APIs:\n=========="

for i in range(max_apis):
    apiinfo = p.get_host_api_info(i)
    print "Number              : ", i
    print "Name                : ", apiinfo.name
    print "Type                : ", apiinfo.type
    print "Devices             : ", apiinfo.deviceCount
    print "defaultInputDevice  : ", apiinfo.defaultInputDevice
    print "defaultOutputDevice : ", apiinfo.defaultOutputDevice
    print "--------------------------"

print "\nDevices:\n========"

for i in range(max_devs):
    devinfo = p.get_device_info(i)
    print "Number                   : ", i
    print "Name                     : ", devinfo.name
    print "hostApi Index            : ",  devinfo.hostApi