如何通过 parselmouth 计算音频子序列的音频指标
How to calculate audio metrics through parselmouth on a subsequence of audio
我正在使用 parselmouth(praat 的包装器)通过这样做来提取强度和音调特征:
snd = parselmouth.Sound(path)
intensity = snd.to_intensity()
pitch = snd.to_pitch()
但是,音频文件包含长序列的静音,我想在计算这些音频指标之前将其删除。我可以通过处理通过 wave 包读取音频(并应用一些逻辑)返回的 numpy 数组来消除静音,但我无法将新数组传递给 parselmouth。
我什至愿意向 parselmouth 提供 startTime 和 endTime 参数,但也找不到支持该参数的文档。
有两个选项可能对这种情况有用:
- 您可以从示例中创建
parselmouth.Sound
而不是从文件中读取。有a constructor taking a NumPy array (or a list/iterable convertible to NumpyArray) and sampling frequency
- 蛇佬腔
Sound
也有 a method Sound.extract_part
(等同于 UI 中 Praat 的 "Extract part..." 按钮)允许你提取碎片(甚至 window 使用与矩形 window) 不同的 window 形状编辑。
请注意,您可能希望在移除静音时留一点或余量,因为 1) 强度和音调分析都使用了一定大小的滑动 window(所以如果您不留一个边距,一些 windows 将超过 'discontinous speech'),并且 2) 音高分析使用启发式来保持 +- 连续的音高轮廓(所以如果你不留边距silence/the检测到没有发声,相邻片段的音高估计会相互影响)。
我正在使用 parselmouth(praat 的包装器)通过这样做来提取强度和音调特征:
snd = parselmouth.Sound(path)
intensity = snd.to_intensity()
pitch = snd.to_pitch()
但是,音频文件包含长序列的静音,我想在计算这些音频指标之前将其删除。我可以通过处理通过 wave 包读取音频(并应用一些逻辑)返回的 numpy 数组来消除静音,但我无法将新数组传递给 parselmouth。
我什至愿意向 parselmouth 提供 startTime 和 endTime 参数,但也找不到支持该参数的文档。
有两个选项可能对这种情况有用:
- 您可以从示例中创建
parselmouth.Sound
而不是从文件中读取。有a constructor taking a NumPy array (or a list/iterable convertible to NumpyArray) and sampling frequency - 蛇佬腔
Sound
也有 a methodSound.extract_part
(等同于 UI 中 Praat 的 "Extract part..." 按钮)允许你提取碎片(甚至 window 使用与矩形 window) 不同的 window 形状编辑。
请注意,您可能希望在移除静音时留一点或余量,因为 1) 强度和音调分析都使用了一定大小的滑动 window(所以如果您不留一个边距,一些 windows 将超过 'discontinous speech'),并且 2) 音高分析使用启发式来保持 +- 连续的音高轮廓(所以如果你不留边距silence/the检测到没有发声,相邻片段的音高估计会相互影响)。