Add local spoken passages with Google retrieval and isolated runtime setup
This commit is contained in:
1 parent
bc9459785d
commit
dab703413e
55 files changed
+3633
-70
No files matched your search
@@ -770,6 +770,27 @@ pub fn decode_audio(
|
||||
path: &Path,
|
||||
window: AudioWindow,
|
||||
limits: &MediaLimits,
|
||||
) -> Result<Vec<f32>> {
|
||||
decode_audio_inner(tools, path, window, limits, false)
|
||||
}
|
||||
|
||||
/// Preserve the source clock across seek offsets and discontinuities for speech citations.
|
||||
/// Silence is derived from decoded frame timestamps, never semantic guesses.
|
||||
pub fn decode_audio_aligned(
|
||||
tools: &FfmpegTools,
|
||||
path: &Path,
|
||||
window: AudioWindow,
|
||||
limits: &MediaLimits,
|
||||
) -> Result<Vec<f32>> {
|
||||
decode_audio_inner(tools, path, window, limits, true)
|
||||
}
|
||||
|
||||
fn decode_audio_inner(
|
||||
tools: &FfmpegTools,
|
||||
path: &Path,
|
||||
window: AudioWindow,
|
||||
limits: &MediaLimits,
|
||||
aligned: bool,
|
||||
) -> Result<Vec<f32>> {
|
||||
ensure!(
|
||||
window.duration_ms > 0 && window.duration_ms <= 30_000,
|
||||
@@ -794,7 +815,12 @@ pub fn decode_audio(
|
||||
.arg(path)
|
||||
.arg("-af")
|
||||
.arg(format!(
|
||||
"aresample=16000,atrim=end_sample={},asetpts=PTS-STARTPTS",
|
||||
"{},atrim=end_sample={},asetpts=PTS-STARTPTS",
|
||||
if aligned {
|
||||
"aresample=16000:async=1:first_pts=0"
|
||||
} else {
|
||||
"aresample=16000"
|
||||
},
|
||||
u64::from(window.duration_ms) * 16
|
||||
))
|
||||
.args([
|
||||
|
||||
Reference in new issue
Block a user