Skip to content

Conversation

@vain
Copy link
Contributor

@vain vain commented Jun 18, 2017

Several improvements (IMHO) to rec. Not sure if you want this. :-)

  • Work around permission issues.
  • Multi-sample recording.
  • Previous code was a bit wonky, at least on my machine, because parec did a lot of buffering and I got incomplete samples very often.
  • Replaced amplitude detection with a simple time-based approach.

vain added 5 commits June 18, 2017 07:26
My user doesn't have access to /dev/input/* by default, so I would need
to run "rec" as root -- which, in turn, breaks recording audio, because
root does not have access to my PulseAudio process.

This commit now allows you to do this:

    $ sudo cat /dev/input/event123 | ./rec
Amplitude detection didn't work too well for me. :/

rec now keeps 1/32s of history. As soon as we detect a key, that history
will be written to the output file. After that, another 1/2s will be
recorded to catch all the "zoingggggg" noises.

Auto-normalization was a bad idea to begin with. We must find the global
peak value of all samples and then normalize all of them using the same
gain.
@zevv
Copy link
Owner

zevv commented Jun 18, 2017 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants