Template program in Python showing how to setup streaming audio processing with PyAudio
.
There are following streaming modes available:
- (build-in input) -> [process] -> (build-in output)
- (build-in input) -> [process] -> (virtual device output)
- (virtual device input) -> [process] -> (build-in output)
- (file) -> [process] -> (file)
- (build-in input) -> [process] -> (file)
- (file) -> [process] -> (build-in output)
- (virtual device input) -> [process] -> (file)
- (file) -> [process] -> (virtual device output)
- PyAudio
- NumPy
Setup
Implement function def __processing(self, signal)
in file py_streaming_dsp.py
.
Change settings.json
to setup audio devices.
If SoundFlower is used in the system, than field virtual_audio_device_name
has value Soundflower (2ch)
.
Run
python {0} [-h, -d, -v, -a, -b] [-i <in file>, -o <out file>]
Press Ctrl+C
to exit.
Command-line options
-h
print this help message-d
print all available devices-v
use virtual audio device instead of built-in (can be used with -i/-o to activate mode 7/8)-a
use built-in input with virtual audio device or built-in output (mode 1 or 2)-b
use built-in output with virtual audio device or built-in input (mode 1 or 3)-i
,--ifile=
provide input wav file-o
,--ofile=
provide output wav file
Use cases
python {0} -a -b
- to activate mode 1python {0} -a
- to activate mode 2python {0} -b
- to activate mode 3python {0} -i infile.wav -o outfile.wav
- to activate mode 4python {0} -o outfile.wav
- to activate mode 5python {0} -i infile.wav
- to activate mode 6python {0} -v -o outfile.wav
- to activate mode 7python {0} -v -i infile.wav
- to activate mode 8
Streaming audio steganography algorithm in Python gs-scrambler is using PyStreamingDSP.
This project is licensed under the terms of the MIT license. (see LICENSE.txt in the root)