diff --git a/examples/README.md b/examples/README.md index 391baa8..f867cb2 100644 --- a/examples/README.md +++ b/examples/README.md @@ -28,6 +28,9 @@ pip install PyAudioWPatch scipy 2) Run the script: `python capture_activations.py --threshold 0.5 --output_dir --model ` +Where `--output_dir` is the desired location to save the activation clips, and `--model` is the model name or full path of the model to use. +If `--model` is not provided, all of the default models will be loaded. + Note that if you have more than one microphone connected to your system, you may need to adjust the PyAudio configuration in the script to select the appropriate input device. ## Benchmark Efficiency diff --git a/examples/capture_activations.py b/examples/capture_activations.py index 5dc3b33..109d4e1 100644 --- a/examples/capture_activations.py +++ b/examples/capture_activations.py @@ -145,10 +145,10 @@ if __name__ == "__main__": print(f'Detected activation from \"{mdl}\" model at time {detect_time}!') - # Capture total of 5 seconds, with the mic_ associated with the + # Capture total of 5 seconds, with the microphone audio associated with the # activation around the ~4 second point audio_context = np.array(list(owwModel.preprocessor.raw_data_buffer)[-16000*5:]).astype(np.int16) fname = detect_time + f"_{mdl}.wav" scipy.io.wavfile.write(os.path.join(os.path.abspath(args.output_dir), fname), 16000, audio_context) - playBeep('audio/activation.wav', audio) + playBeep(os.path.join(os.path.dirname(__file__), 'audio', 'activation.wav'), audio)