Skip to content

Install Miles on MacOS (Easy Install method)

Anthony Hayward edited this page Feb 18, 2024 · 5 revisions

🚀 Download and Install (Mac easy install)

Follow these steps to get everything set up on your Mac:

  1. Install Homebrew:

    /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
    
  2. Install Python 3.11:

    brew install python@3.11
    
  3. Install PortAudio:

    brew install portaudio
    
  4. Create Virtual Environment:

    python3.11 -m venv Miles-env
    
  5. Activate Virtual Environment:

    source Miles-env/bin/activate
    
  6. Go to created folder:

    cd ~/Miles-env
    
  7. Install Git:

    brew install git
    
  8. Clone the Repo:

    git clone https://github.com/small-cactus/M.I.L.E.S.git
    
  9. Run setup script:
    Navigate to the script directory:

     cd ~/Miles-env/M.I.L.E.S/Miles-V2
    

    Next, make the script executable:

     chmod +x setup.sh
    

    Finally, run the setup script:

     ./setup.sh
    
  10. Config:
    🥳 The app will guide you through setup once it's open. You'll need:

    • OpenAI API key
    • Picovoice API key
    • Spotify client ID
    • Spotify Client Secret
    • Your city
    • Your preferred Unit
      All necessary steps are included in the app.

🔄 To Start the App Again

If you've previously installed and set up the app, you may only need to activate the virtual environment and start the app. There are two ways to do this:

Method 1: Manual Start

  1. Activate Virtual Environment (if not already activated):
    Sometimes, especially after restarting your Mac or opening a new terminal window, you'll need to reactivate the virtual environment to ensure that the correct Python and dependency versions are being used. Activate it by navigating to your project folder and running:

    source ~/Miles-env/bin/activate
    
  2. Start the App:
    Once the environment is activated, navigate to the app's root directory if you're not already there. Then, you can start the app using npm:

    cd ~/Miles-env/M.I.L.E.S/Miles-V2
    
    npm start
    

    This command will launch the application, and you should be ready to go!

Remember, activating the virtual environment is only necessary if it's not already active. You can tell if it's active by the environment name (Miles-env) appearing at the beginning of your terminal prompt.


Method 2: Using a Siri Shortcut (macOS Monterey and later)

For a quicker start, use the provided Siri Shortcut. This method requires no manual command entry after initial setup.

  1. Download the Shortcut: Click the following link to download the Siri Shortcut for starting the app. This link will take you to a page where you can get and add the shortcut to your collection.

Download Siri Shortcut

  1. Run the Shortcut: After adding the shortcut to your collection, you can run it by invoking Siri and saying the name of the shortcut or by finding it in the Shortcuts app and clicking on it. This will activate the virtual environment and start the app with a single action.

I recommend adding it to a menu bar shortcut, you can also change the name of the shortcut to anything you want, then you just invoke Siri and say the name, and it should start.


⚠️ QuickFix for known issue:

If you encounter audio bitrate issues, follow these steps:

Click to expand!
  1. Open Audio MIDI Setup

    • CMD + Space, then type Audio MIDI Setup.
  2. Select Your Microphone

    • Find and select your microphone in the left-hand pane.
  3. Change the Format

    • With your microphone selected, choose 44100.0 Hz and 2ch-24bit from the Format dropdown menu on the bottom right.
  4. Apply the Changes

    • Close the window; settings apply automatically.
  5. Restart Miles

    • Quit and reopen Miles for the changes to take effect.

Known Compatibility Issues

  • AirPods Limitation:
    AirPods and some Bluetooth headphones may not work well with Miles due to audio bitrate limitations. It's advisable to use a wired connection, Mac's built-in mic, or a high-quality Bluetooth microphone supporting at least 44100.0 Hz and 24-bit recording. This limitation stems from the Speech Recognition Library in Python, not from Miles itself.