- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在使用 USB-powered ultrasonic microphone 制作一个 Raspberry Pi bat 探测器.我希望能够在记录 bat 的同时排除昆虫和其他非 bat 的噪音。录音需要声音触发,以避免过快地填充 SD 卡并帮助分析。 This website解释了如何使用 SoX 做到这一点:
rec - c1 -r 192000 record.wav sinc 10k silence 1 0.1 1% trim 0 5
这会在至少 0.1 秒的触发声音后记录 5 秒,并包括一个 10kHz 高通滤波器。这是一个好的开始,但我真正想要的是一个高级过滤器,可以排除蟋蟀和其他非 bat 的噪音。昆虫和 bat 的叫声在频率上重叠,因此高通或带通滤波器不起作用。
Elekon Batlogger使用分析过零的周期触发器来执行此操作。来自 Batlogger 网站:
The difference in sound production of bats (vocal cords) and insects(stridulation) affects the period continuity. The period trigger takesadvantage of this:
The trigger fires when ProdVal and DivVal are lower than the setlimits, so if the values are within the yellow range.(Values mean default values): ProdVal = 8, higher values triggereasier DivVal = 20, higher values trigger easier
图片中的翻译文本:
Bat: Tonal signal
Period constant => zero crossings / time = stable
Insects: scratching
Period constant => zero crossings / time = differs
MN => mean value of the number of periods per measurement interval
SD => standard deviation of the number of periods
Higher values trigger better even at low frequencies (also insects!)And vice versa
有没有办法在 Raspberry Pi OS 中实现这个(或具有相同效果的东西)?我最熟悉的语言是 R。基于对 this question 的回答看起来 R 似乎适合这个问题,但如果 R 不是最佳选择,那么我愿意接受其他建议。
我真的很感激上面描述的用于录制音频和过滤的一些工作代码。我想要的输出是包含 bat 叫声的 5 秒文件,而不是昆虫或噪音。需要在 CPU/电源使用方面高效,并且需要即时工作。
bat 和昆虫的录音示例 here .
我有一个在 Python 中运行的基本声音激活脚本 (based on this answer),但我不确定如何在其中包含一个高级过滤器:
import pyaudio
import wave
from array import array
import time
FORMAT=pyaudio.paInt16
CHANNELS=1
RATE=44100
CHUNK=1024
RECORD_SECONDS=5
audio=pyaudio.PyAudio()
stream=audio.open(format=FORMAT,channels=CHANNELS,
rate=RATE,
input=True,
frames_per_buffer=CHUNK)
nighttime=True # I will expand this later
while nighttime:
data=stream.read(CHUNK)
data_chunk=array('h',data)
vol=max(data_chunk)
if(vol>=3000):
print("recording triggered")
frames=[]
for i in range(0, int(RATE / CHUNK * RECORD_SECONDS)):
data = stream.read(CHUNK)
frames.append(data)
print("recording saved")
# write to file
words = ["RECORDING-", time.strftime("%Y%m%d-%H%M%S"), ".wav"]
FILE_NAME= "".join(words)
wavfile=wave.open(FILE_NAME,'wb')
wavfile.setnchannels(CHANNELS)
wavfile.setsampwidth(audio.get_sample_size(FORMAT))
wavfile.setframerate(RATE)
wavfile.writeframes(b''.join(frames))
wavfile.close()
# check if still nighttime
nighttime=True # I will expand this later
stream.stop_stream()
stream.close()
audio.terminate()
最佳答案
R 应该能够在后处理中执行此操作。如果您想在现场录音/流媒体上完成此操作,我建议您寻找其他工具。
R 能够通过多个包处理音频文件(最值得注意的似乎是 tuneR ),但我相当确定这将仅限于收集后处理,即分析您已经收集的文件,而不是而不是流式音频输入的“实时”过滤。
您可以采用多种方法“实时”过滤昆虫/不需要的声音。一种是只记录上面列出的文件,然后编写 R 代码来处理它们(例如,您可以使用 cron 按计划自动执行此操作)并丢弃不符合您标准的部分或文件。如果您担心 SD 卡空间,您也可以在处理后将这些文件卸载到另一个位置(即上传到某个地方的另一个驱动器)。您可以将此设置为相当短的时间范围(冒着 Pi 上 CPU 使用率的风险),以获得“几乎实时”的处理方法。
另一种方法是更多地查看 sox documentation看看那里是否有选项可以根据流式音频输入实现您想要的效果,或者看看是否有其他工具可以将输入流式传输到,这将允许进行那种过滤。
维尔·格吕克!
关于python - Raspberry Pi 上的声音激活录音和高级过滤,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/68212491/
我正在使用 twilio JS 客户端从 Web 进行调用。客户端调用后端获取 token 。这里是返回 token 的后端代码。如何记录通话。表示在哪里设置录制网址。通话成功。但是不知道从哪里传录音
我有一个软件,可以记录 5 秒间隔的声音,然后将其发送进行处理。它在无限循环中运行,如下所示: while (true) { System.out.println("recording..")
我目前正在做一个项目,需要录制 iPhone 播放的声音。通过这个,我的意思是录制在后台播放的声音,如声音剪辑或其他任何东西,而不是使用内置麦克风。 这能做到吗?我目前正在试验 AVAudioReco
当我将蓝牙免提连接到 Android 手机设备时,是否可以使用手机麦克风录制声音并在免提中听到? 我设法通过手机麦克风录制声音,并通过手机扬声器或耳机听到声音。但是当耳机有麦克风时,通常是免提,它默认
我想访问我在我的应用程序中记录的跟踪数据和自定义数据。 有人可以提供不同数据轨道保存在 mp4 中的格式吗? 使用这个例子https://github.com/google-ar/arcore-and
我想知道,在C++中进行音频记录/回放/搜索的跨平台实用工具是什么?我当时在考虑采用ALUT(OpenAL)的路线,但是有更好的方法吗?如果不是,你们是否知道ALUT的任何优秀教程/示例代码? 最佳答
我目前正在开发一个项目,该项目允许用户录制音频消息,但是最近提出了一个要求,允许他们暂停录制过程,然后继续录制(将新的音频追加到之前的录制之后)。 示例: 用户按下记录并进行初始记录。 用户按下暂停按
我见过几个这样的例子,但它们似乎是针对旧版本的 SDK。我正在尝试设置基本的录音,以下代码在针对 SDK 2.0 版时给我一个 NullPointerException。 ContentValues
我开发了一款安卓游戏,使用 Audio Record 获取麦克风输入。 可以看一下https://play.google.com/store/apps/details?id=fixappmedia.m
我想在最近的项目中使用该插件进行音频捕获。我找到了 Matt Diamond 的努力 demo here正如大多数文章所指向的那样。我尝试在本地重新创建这个完全相同的演示,但没有成功。 我包括了所有依
我正在设置录音机,但在 soundRecorder = try AVAudioRecorder(URL: getFileURL(), settings: recordSettings as! [Str
作为一名吉他手,我一直想开发自己的录音、混音软件。我在 Direct Sound、Windows Multimedia(waveOutOpen 等)方面有一些经验。我意识到这将是一个复杂的项目,但纯粹
我不想记录我自己的击键来创建 asciinema 教程,而是想编写它们的脚本,这样我就可以随着时间的推移轻松地改进我的教程,而不必担心每次我想进行更改时都要重做,或者花很多时间尝试更正录音中的错别字。
我正在尝试使用 Flutter 构建一个应用程序,其中包含录音机。如何访问录音机?请帮我弄清楚它的包、依赖项和代码。 最佳答案 您可以使用 audio_recorder 包: https://pub.
掌握 Java Flight recorder (JFR) 配置,我有一个最合理的配置: -XX:+UnlockCommercialFeatures -XX:+DebugNonSafepoints -
我正在尝试播放我从 twilio 取回的通话录音。到目前为止,我在我的网站上有一个所有通话录音的列表,当我点击它们时,它会将我发送到 twilio 以收听它们。然后我发出一个 ajax 请求以从 tw
我们可以用 iPhone 直接线路输入录制音频吗? 最佳答案 唯一的方法是使用底座连接器创建您自己的配件,然后使用提供的 API! 关于iPhone LINE-IN 录音 可以吗?,我们在Stack
基本上,我希望用户使用 SoundCloud 录音机录制声音,一旦他们单击“保存”,他们刚刚录制的声音就会嵌入到我的网页中。 我使用 SC.record() 方法来获取录音。这是我保存录音的功能...
我正在尝试在网站中实现录音。基本上,用户应该能够按下一个按钮并对着麦克风说些什么。然后应将录制的音频发送到服务器以进行进一步处理。我知道您可以使用 Flash 做到这一点,但现在我正在努力避免这种情况
我正在尝试“录制”一个音频文件,我读过这个 doc ,实际上我想在文件中将“采样”值记录为双倍值,这是我使用的代码(不起作用,我不知道为什么没有): /* Use the newer ALSA API
我是一名优秀的程序员,十分优秀!