I want to record the output of Google Text to speech to a mp3 file. I need a command that I can use in Terminal. I read sox
can record audio, however don't know how to set up it to record the output audio of my computer. I also prefer to automatically stop recording if the audio output was silent for at least 3 seconds... Any other tool for this purpose is acceptable.
I've been trying to find (or make) a voice changer for a project I have with some friends for a tabletop gameover Discord, which includes role-playing. Thing is, I can't find any real-time voice modifier/changer/modulator that works on Ubuntu, and can also be detected in Discord as a viable Input Device. Reading other forum posts, I've tried the following:
- pyvoicechanger, which only works on pitch, and Discord can't detect.
- Jack Rack, which Discord doesn't support at the moment (See this issue)
- And finally, according to these two already asked questions (one and two), sox.
The last one is the only one I haven't confirmed as "not working" since, according to the mentioned seconds post, it requires outputting the audio to a "null sink", which neither Chrome nor any other Ubuntu recorder/app detects
So, what I want to ask is: Is there an alternative to voice changer, being manual modulators using chorus, pitch, etc; or simple voice changers using defined settings ("robot", "giant", "helium voice", etc) that can work with different apps in Ubuntu? (Or at least with Discord)
I'm playing around with the SoX, an audio conversion program. After installation I notice that it creates a symbolic link /usr/bin/play -> sox
. I notice that I can play an audio file with play my_song.wav
, but if I try sox my_song.wav
I get an error about not having enough inputs specified.
I don't understand this behavior because I didn't think running a program through a symbolic link would be any different than running it through the target directly. What mechanism is allowing this difference in behavior?
I have this command (for pomodoros):
play -n synth 25:00 pinknoise
I don't want to silent completely the output (-q
option), just the header (grep
don't work).
Normal output:
File Size: 94.3T
Encoding: n/a
Channels: 1 @ 32-bit
Samplerate: 48000Hz
Replaygain: off
Duration: unknown
In:0.00% 00:00:01.02 [00:00:00.00] Out:49.2k [======|======] Hd:1.3 Clip:0
Desire filtered output: 01.02
(this number is updated, like in a cURL or pv
progress bar)
How can I grep just that part of the output?
So far:
For some reason the output is sent to stderr, like with "Permission denied" from
find
. An easy way to test is to add at the end2> /dev/null
.Maybe the reason why sox/play output to stderr is because it supports writing the output to standard output (stdout) using the special filename
-
(see sox man page).But
|& grep "^In"
won't work. Using|& tee log.txt
it seems uses the delete character to update the last line.I tried
grep --line-buffered
,unbuffer
andstdbuf
(after reading this and this) with some great progress:play -n synth 25:00 pinknoise 2>&1 | stdbuf -oL tr '\r' '\n' | grep -o '[0-9][0-9]*\.[0-9][0-9] '
That's very close!
Is possible to get only just one updated line like was on the original output? Maybe like this loop with echo -ne
.
I'm not sure why something like | grep --line-buffered .
doesn't work, neither removing trailing newline: | tr -d '\n'
. I need something like tail -f -n 1
.
I'm trying to add background audio to a primary wav file.
sox -m primary.wav background.wav output.wav
I have about 5s of background chatter in background.wav and I'd like the output to always be at the length of primary. How can I make sox loop and trim background.wav to the length of primary for mixing in shell?