MCPcopy Create free account
hub / github.com/DamRsn/NeuralNote / stopRecording

Method stopRecording

NeuralNote/Source/SourceAudioManager.cpp:157–197  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

155}
156
157void SourceAudioManager::stopRecording()
158{
159 {
160 ScopedLock sl(mWriterLock);
161 mIsRecording.store(false);
162 }
163
164 mThreadedWriter.reset();
165 mThreadedWriterDown.reset();
166
167 mWriterThread.stopThread(1000);
168 mWriterThreadDown.stopThread(1000);
169
170 bool success = AudioUtils::loadAudioFile(mSourceFile, mSourceAudio, mSourceAudioSampleRate);
171 jassert(mSourceAudioSampleRate == mSampleRate);
172
173 // Should def not happen
174 if (!success) {
175 mProcessor->clear();
176 NativeMessageBox::showMessageBoxAsync(
177 MessageBoxIconType::NoIcon, "Could not load the recorded audio sample.", "");
178 return;
179 }
180
181 double dummy_sr;
182 success = AudioUtils::loadAudioFile(mRecordedFileDown, mDownsampledSourceAudio, dummy_sr);
183 jassert(dummy_sr == BASIC_PITCH_SAMPLE_RATE);
184
185 // Should def not happen
186 if (!success) {
187 mProcessor->clear();
188 NativeMessageBox::showMessageBoxAsync(
189 MessageBoxIconType::NoIcon, "Could not load the recorded audio sample.", "");
190 return;
191 }
192
193 auto& tree = mProcessor->getValueTree();
194 tree.setPropertyExcludingListener(this, NnId::SourceAudioNativeSrPathId, mSourceFile.getFullPathName(), nullptr);
195
196 mProcessor->getTranscriptionManager()->setLaunchNewTranscription();
197}
198
199bool SourceAudioManager::onFileDrop(const File& inFile)
200{

Callers 1

NeuralNoteMainViewMethod · 0.80

Calls 5

loadAudioFileFunction · 0.85
resetMethod · 0.45
clearMethod · 0.45

Tested by

no test coverage detected