예제 #1
0
파일: pyaudio.py 프로젝트: endolith/PyAudio
    def get_default_output_device_info(self):
        """
        Return the default output Device parameters as a
        dictionary. The keys of the dictionary mirror the data fields
        of PortAudio's ``PaDeviceInfo`` structure.

        :raises IOError: No default output device available.
        :rtype: dict
        """

        device_index = pa.get_default_output_device()
        return self.get_device_info_by_index(device_index)
예제 #2
0
파일: pyaudio.py 프로젝트: chai41104/NLP
    def get_default_output_device_info(self):
        """
        Return the default output Device parameters as a
        dictionary. The keys of the dictionary mirror the data fields
        of PortAudio's ``PaDeviceInfo`` structure.

        :raises IOError: No default output device available.
        :rtype: dict
        """

        device_index = pa.get_default_output_device()
        return self.get_device_info_by_index(device_index)
예제 #3
0
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
    print "maxInputChannels         : ", devinfo.maxInputChannels
    print "maxOutputChannels        : ", devinfo.maxOutputChannels
    print "defaultLowInputLatency   : ", devinfo.defaultLowInputLatency
    print "defaultLowOutputLatency  : ", devinfo.defaultLowOutputLatency
    print "defaultHighInputLatency  : ", devinfo.defaultHighInputLatency
    print "defaultHighOutputLatency : ", devinfo.defaultHighOutputLatency
    print "defaultSampleRate        : ", devinfo.defaultSampleRate
    print "--------------------------------"

print "\nDefault Devices:\n================"
try:
    print "Input  :", p.get_default_input_device()
except IOError, e:
    print "No Input devices."

try:
    print "Output :", p.get_default_output_device()
except IOError, e:
    print "No Output devices."

p.terminate()