# Path: fofix/core/Language.py
# def getAvailableLanguages():


import logging
import math
import numpy as np
    import pyaudio
from fretwork.task import Task
from fretwork.audio import MicrophonePassthroughStream
from fofix.core.Language import _
    from pypitch import pypitch
                self.devname = pa.get_device_info_by_index(devnum)['name']
            self.mic = pa.open(samprate, 1, pyaudio.paFloat32, input=True, input_device_index=devnum, start=False)
            self.analyzer = pypitch.Analyzer(samprate)
            self.mic_started = False
            self.lastPeak    = 0
            self.detectTaps  = True
            self.tapStatus   = False
            self.tapThreshold = -self.engine.input.controls.micTapSensitivity[controlnum]
            self.passthroughQueue = []
            passthroughVolume = self.engine.input.controls.micPassthroughVolume[controlnum]
            if passthroughVolume > 0.0:
                log.debug('Microphone: creating passthrough stream at %d%% volume' % round(passthroughVolume * 100))
                self.passthroughStream = MicrophonePassthroughStream(engine, self)
                self.passthroughStream.setVolume(passthroughVolume)
            else:
                log.debug('Microphone: not creating passthrough stream')
                self.passthroughStream = None

        def __del__(self):
            self.stop()
            self.mic.close()

        def start(self):
            if not self.mic_started:
                self.mic_started = True
                self.mic.start_stream()
                self.engine.addTask(self)
                log.debug('Microphone: started %s' % self.devname)
                if self.passthroughStream is not None:
                    log.debug('Microphone: starting passthrough stream')

# Path: fofix/core/Language.py
# def getAvailableLanguages():


# Path: fofix/core/Microphone.py
import logging
import math
import numpy as np
    import pyaudio
from fretwork.task import Task
from fretwork.audio import MicrophonePassthroughStream
from fofix.core.Language import _
    from pypitch import pypitch

                self.devname = pa.get_device_info_by_index(devnum)['name']
            self.mic = pa.open(samprate, 1, pyaudio.paFloat32, input=True, input_device_index=devnum, start=False)
            self.analyzer = pypitch.Analyzer(samprate)
            self.mic_started = False
            self.lastPeak    = 0
            self.detectTaps  = True
            self.tapStatus   = False
            self.tapThreshold = -self.engine.input.controls.micTapSensitivity[controlnum]
            self.passthroughQueue = []
            passthroughVolume = self.engine.input.controls.micPassthroughVolume[controlnum]
            if passthroughVolume > 0.0:
                log.debug('Microphone: creating passthrough stream at %d%% volume' % round(passthroughVolume * 100))
                self.passthroughStream = MicrophonePassthroughStream(engine, self)
                self.passthroughStream.setVolume(passthroughVolume)
            else:
                log.debug('Microphone: not creating passthrough stream')
                self.passthroughStream = None

        def __del__(self):
            self.stop()
            self.mic.close()

        def start(self):
            if not self.mic_started:
                self.mic_started = True
                self.mic.start_stream()
                self.engine.addTask(self)
                log.debug('Microphone: started %s' % self.devname)
                if self.passthroughStream is not None:
                    log.debug('Microphone: starting passthrough stream')

                    self.passthroughStream.play()