-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.sh
More file actions
executable file
·157 lines (139 loc) · 4.28 KB
/
setup.sh
File metadata and controls
executable file
·157 lines (139 loc) · 4.28 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
#!/bin/bash
echo "Meeting Recorder - Setup Script"
echo "================================"
echo ""
# Check if running on macOS
if [[ "$OSTYPE" != "darwin"* ]]; then
echo "❌ This app requires macOS"
exit 1
fi
# Check for Homebrew
if ! command -v brew &> /dev/null; then
echo "❌ Homebrew not found. Install from: https://brew.sh"
exit 1
fi
echo "✅ macOS and Homebrew detected"
echo ""
# Install sox
echo "📦 Installing sox..."
if command -v sox &> /dev/null; then
echo "✅ sox already installed ($(sox --version | head -n1))"
else
brew install sox
echo "✅ sox installed successfully"
fi
echo ""
# Check for BlackHole
echo "🔍 Checking for BlackHole audio device..."
if system_profiler SPAudioDataType | grep -q "BlackHole"; then
echo "✅ BlackHole detected"
else
echo "⚠️ BlackHole 2ch not detected"
echo ""
echo " BlackHole is required to capture system audio."
echo " Download from: https://github.com/ExistentialAudio/BlackHole"
echo ""
echo " After installation:"
echo " 1. Open Audio MIDI Setup"
echo " 2. Create a Multi-Output Device"
echo " 3. Check both your speakers and BlackHole 2ch"
echo " 4. Set Multi-Output Device as your system output"
echo ""
read -p "Press Enter after installing BlackHole to continue..."
fi
echo ""
# Check for Ollama
echo "📦 Checking for Ollama..."
if command -v ollama &> /dev/null; then
echo "✅ Ollama already installed"
# Check if llama model is available
echo "🔍 Checking for Ollama models..."
if ollama list | grep -q "llama"; then
echo "✅ Ollama model found"
else
echo "📥 Pulling llama3.2 model (this may take a while)..."
ollama pull llama3.2
echo "✅ llama3.2 model downloaded"
fi
else
echo "📦 Installing Ollama..."
brew install ollama
echo "🚀 Starting Ollama service..."
brew services start ollama
# Wait for Ollama to start
sleep 3
echo "📥 Pulling llama3.2 model (this may take a while)..."
ollama pull llama3.2
echo "✅ Ollama and llama3.2 model installed"
fi
echo ""
# Check for cmake (required for whisper.cpp compilation)
echo "📦 Checking for cmake..."
if ! command -v cmake &> /dev/null; then
echo "📥 Installing cmake..."
brew install cmake
echo "✅ cmake installed"
else
echo "✅ cmake already installed"
fi
echo ""
# Clone and build whisper.cpp
echo "📦 Setting up whisper.cpp..."
if [ ! -d "whisper.cpp" ]; then
echo "📥 Cloning whisper.cpp repository..."
git clone https://github.com/ggerganov/whisper.cpp.git
else
echo "✅ whisper.cpp directory already exists"
fi
# Check if binary exists, compile if not
# New location: whisper.cpp/build/bin/whisper-cli (CMake build)
# Old location: whisper.cpp/main (old Makefile build)
if [ -f "whisper.cpp/build/bin/whisper-cli" ] || [ -f "whisper.cpp/main" ]; then
echo "✅ whisper.cpp binary already compiled"
else
echo "🔨 Compiling whisper.cpp..."
cd whisper.cpp
make
cd ..
if [ -f "whisper.cpp/build/bin/whisper-cli" ]; then
echo "✅ whisper.cpp compiled successfully (CMake build)"
elif [ -f "whisper.cpp/main" ]; then
echo "✅ whisper.cpp compiled successfully (Makefile build)"
else
echo "❌ Compilation failed - please check for errors above"
fi
fi
echo ""
# Download whisper model
echo "📥 Checking for whisper model..."
if [ -f "whisper.cpp/models/ggml-base.en.bin" ]; then
echo "✅ Whisper model already downloaded"
else
echo "📥 Downloading base.en model (this may take a while)..."
cd whisper.cpp
bash ./models/download-ggml-model.sh base.en
cd ..
echo "✅ Whisper model downloaded"
fi
echo ""
# Copy model to models directory
if [ -f "models/ggml-base.en.bin" ]; then
echo "✅ Model already in models/ directory"
else
echo "📋 Copying model to models/ directory..."
cp whisper.cpp/models/ggml-base.en.bin models/
echo "✅ Model copied"
fi
echo ""
echo "================================"
echo "✅ Setup complete!"
echo ""
echo "Next steps:"
echo " 1. Configure Multi-Output Device in Audio MIDI Setup"
echo " (System audio → Multi-Output Device with BlackHole + Speakers)"
echo " 2. Ensure Ollama is running: ollama serve"
echo " 3. Run the app: npm start"
echo " 4. Click the menu bar icon to start recording"
echo ""
echo "For troubleshooting, see the README.md file"
echo "================================"