我想在Linux下使用笔记本电脑作为鼻窦发生器.但我还没有找到一个可以产生声音的程序.有人可以告诉我正确的程序或脚本.谢谢.
PS:我不想用它来酿酒.PS2:我发现了这个:"aoss siggen"和"speaker_test".但首先是基于ncurses而第二个不能生成连续信号.你可能知道更多吗?
Cir*_*四事件 12
ffmpeg
像往常一样,ffmpeg 可以做到。
创建 2 秒单声道 1000 Hz 正弦out.wav声音文件:
sudo apt-get install ffmpeg
ffmpeg -f lavfi -i "sine=f=1000:d=2" out.wav
Run Code Online (Sandbox Code Playgroud)
立体声改为-ac 2:
ffmpeg -f lavfi -i "sine=f=1000:d=2" -ac 2 out.wav
Run Code Online (Sandbox Code Playgroud)
该文件将是原来的 2 倍大,并且ffprobe会显示它已2 channels替换为1 channel.
左侧生成 2 秒 500 Hz,右侧生成 1000 Hz 的 2 秒,相关问题:如何使用每个通道具有不同频率的 FFMPEG 生成立体声正弦波?
ffmpeg -filter_complex '
sine=f=500[0];
sine=f=1000[1];
[0][1]amerge,atrim=end=2
' out.wav
Run Code Online (Sandbox Code Playgroud)
播放 1000 Hz 2 秒而不创建文件:
ffplay -autoexit -nodisp -f lavfi -i 'sine=f=1000:d=2'
Run Code Online (Sandbox Code Playgroud)
永远播放 1000 Hz 直到你发疯:
ffplay -nodisp -f lavfi -i "sine=f=1000"
Run Code Online (Sandbox Code Playgroud)
在两个通道上产生 500 Hz 和 1000 Hz 的 2 秒混合/叠加,相关问题:How to override/downmix two audio files using ffmpeg
ffplay -nodisp -autoexit -f lavfi -i '
sine=f=500[0];
sine=f=1000[1];
[0][1]amix=inputs=2, atrim=end=2
'
Run Code Online (Sandbox Code Playgroud)
产生 2 秒 500 Hz 的频率,然后产生 2 秒 1000 Hz 的频率:
ffplay -nodisp -autoexit -f lavfi -i '
sine=f=500:d=2[0];
sine=f=1000:d=2[1];
[0][1]concat=n=2:v=0:a=1
'
Run Code Online (Sandbox Code Playgroud)
2 秒 250 Hz + 500 Hz,然后是 2 秒 1000 Hz + 2000 Hz:
ffplay -nodisp -autoexit -f lavfi -i '
sine=f=250[0];
sine=f=500[1];
sine=f=1000[2];
sine=f=2000[3];
[0][1]amix=inputs=2, atrim=end=2[01];
[2][3]amix=inputs=2, atrim=end=2[23];
[01][23]concat=n=2:v=0:a=1[out];
'
Run Code Online (Sandbox Code Playgroud)
10秒内从0到20 kHz的频率扫描,主要问题:https ://superuser.com/questions/1156429/how-to-generate-a-time-dependent-Frequency-wave/1156468#1156468
ffplay -autoexit -f lavfi -i "aevalsrc='sin(2000*t*2*PI*t)':d=10"
Run Code Online (Sandbox Code Playgroud)
文档:
音频源下的其他部分记录了除 之外的其他有用的声音生成算法sine,例如:
参考书目:
在 ffmpeg 6.0、Ubuntu 23.10 上测试。
无需额外库的最小 C 音频生成示例
只是为了好玩:音频在计算机中如何用数字表示?
$ pactl load-module module-sine frequency=1000
Run Code Online (Sandbox Code Playgroud)
并使其停止:
$ pactl unload-module module-sine
Run Code Online (Sandbox Code Playgroud)
在谷歌上浏览了一下,我发现了这个软件,不确定它是否是你要找的。
http://www.softpedia.com/get/Multimedia/Audio/Other-AUDIO-Tools/Multisine.shtml
你可以在酒下运行它。
哦...在原帖的附加说明之前,抱歉。
编辑:哇哦,找到了!
http://www.comp.leeds.ac.uk/jj/linux/siggen.html
显然 Audacity 软件也可以做到这一点。
参考http://ubuntuforums.org/showthread.php?t=308065