![]() ![]() You may be interested in an answer I posted recently showing how to set the PulseAudio Equalizer from the command-line. I kind of wish that audio stuff on Linux had better documentation and error reporting. This is why I have -no-remix -no-remap in paplay above I just want the raw channel ordering for the sox command. I originally created an ALSA device wrapping the PulseAudio device, but then I found that it is impossible to control the channel mapping using ALSA, and so random channels were getting mixed together according to how my custom channel-map differed from the ALSA default. In this example we have a six-channel device and we're sending a tone to the third channel. It is much more powerful but we only use the basic functionality here. The remix effect is just used to send the result to a specific channel. sox-paplay synth sine 1000 gain -5 remix -m 0 0 1 0 0 0 Sox -c $NCHAN -n -t raw -r $HZ -L -b 16 - | paplay -no-remix -no-remap -raw -v -p -rate $HZ -d $SINK -channels $NCHANĮ.g. The pipeline is tedious so I created a script: $ cat sox-paplay I had trouble interfacing SoX with PulseAudio so I just pipe sox raw data into paplay. There were some stumbling blocks but I was eventually able to figure it out. You can easily synthesize tones with SoX. Minimal C audio generation example without extra libraries aevalsrc takes arbitrary mathematical expressions, and should therefore be able to produce triangular waveforms (TODO expression) ffmpeg -f image2 -i imaged.jpg video.mpg Convert a Video to X Images This command will generate imagess named image1.jpg, image2.jpg, etc, from a given video file.anoisesrc: noises of several colors, e.g.The other section sunder Audio sources document other useful sound generation algorithms in addition to sine, e.g.: Play forever until you go mad: ffplay -f lavfi -i "sine=frequency=1000" -nodisp Play the audio for 5 seconds without creating a file: ffplay -f lavfi -i "sine=frequency=1000:duration=5" -autoexit -nodisp The file will be 2x as large, and ffprobe will say it has 2 channels instead of 1 channel. Stereo instead with -ac 2: ffmpeg -f lavfi -i "sine=frequency=1000:duration=5" -ac 2 out.wav Create a 5 seconds mono 1000Hz sinusoidal out.wav sound file: sudo apt-get install ffmpegįfmpeg -f lavfi -i "sine=frequency=1000:duration=5" out.wav ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |