RedHenLab / RedHenAnonymizer

Audio and Video Anonymizer for Red Hen Lab
MIT License
2 stars 3 forks source link

Add further sox options for audio deidentification #8

Open peteruhrig opened 2 years ago

peteruhrig commented 2 years ago

On the command line, the following commands were successful for stereo audio with 44.1 kHz sampling rate: First, create audio from the video:

ffmpeg -i covid.mp4 covid.wav

Then, find out exact length, sampling rate and number of channels, in our cases 49.53 seconds, 44100 Hz and 2 channels (stereo):

ffprobe covid.wav

Create a sine wave with the same length, sampling rate and number of channels:

sox -n -r 44100 sine-200.wav synth 49.53 sine 200 remix 1 1

Combine the two into the deidentified audio:

sox -T covid.wav sine-200.wav  covid_distorted_sine-200.wav

A value of 200 makes it still easy to understand, a value of 500 is relatively difficult. Users are invited to experiment with the exact value that works best for their use case.

These steps need to be integrated into the code and made configurable via the command line interface.

peteruhrig commented 2 years ago

Actually, a value of 300 is still intelligible, so we should use this as our default.