# 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
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the     #
# GNU General Public License for more details.                      #
#                                                                   #
# You should have received a copy of the GNU General Public License #
# along with this program; if not, write to the Free Software       #
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,        #
# MA  02110-1301, USA.                                              #
#####################################################################




log = logging.getLogger(__name__)

try:
    supported = True
except ImportError:
    log.warning('Missing pyaudio or pypitch - microphone support will not be possible')
    supported = False

if supported:
    pa = pyaudio.PyAudio()

    # Precompute these in the interest of saving CPU time in the note analysis loop
    LN_2 = math.log(2.0)
    LN_440 = math.log(440.0)

    #stump: return dictionary mapping indices to device names
    # -1 is magic for the default device and will be replaced by None when actually opening the mic.
    def getAvailableMics():

# 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

# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the     #
# GNU General Public License for more details.                      #
#                                                                   #
# You should have received a copy of the GNU General Public License #
# along with this program; if not, write to the Free Software       #
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,        #
# MA  02110-1301, USA.                                              #
#####################################################################




log = logging.getLogger(__name__)

try:
    supported = True
except ImportError:
    log.warning('Missing pyaudio or pypitch - microphone support will not be possible')
    supported = False

if supported:
    pa = pyaudio.PyAudio()

    # Precompute these in the interest of saving CPU time in the note analysis loop
    LN_2 = math.log(2.0)
    LN_440 = math.log(440.0)

    #stump: return dictionary mapping indices to device names
    # -1 is magic for the default device and will be replaced by None when actually opening the mic.
    def getAvailableMics():

        result = {-1: _('[Default Microphone]')}