Land release blocker fixes and workspace cleanup
This commit is contained in:
@@ -42,9 +42,8 @@ impl WavWriter {
|
||||
};
|
||||
let file = std::fs::File::create(path).map_err(KonError::Io)?;
|
||||
let buffered = BufWriter::new(file);
|
||||
let inner = hound::WavWriter::new(buffered, spec).map_err(|e| {
|
||||
KonError::Io(std::io::Error::other(format!("WAV create failed: {e}")))
|
||||
})?;
|
||||
let inner = hound::WavWriter::new(buffered, spec)
|
||||
.map_err(|e| KonError::Io(std::io::Error::other(format!("WAV create failed: {e}"))))?;
|
||||
Ok(Self {
|
||||
inner,
|
||||
samples_since_flush: 0,
|
||||
@@ -77,9 +76,9 @@ impl WavWriter {
|
||||
/// `Self::DEFAULT_FLUSH_EVERY_SAMPLES` — but may do so at natural
|
||||
/// boundaries (end-of-utterance, UI events) for tighter recovery.
|
||||
pub fn flush(&mut self) -> Result<()> {
|
||||
self.inner.flush().map_err(|e| {
|
||||
KonError::Io(std::io::Error::other(format!("WAV flush failed: {e}")))
|
||||
})?;
|
||||
self.inner
|
||||
.flush()
|
||||
.map_err(|e| KonError::Io(std::io::Error::other(format!("WAV flush failed: {e}"))))?;
|
||||
self.samples_since_flush = 0;
|
||||
Ok(())
|
||||
}
|
||||
@@ -244,8 +243,7 @@ mod tests {
|
||||
let _ = std::fs::remove_file(&path);
|
||||
|
||||
// Write 100 samples (200 bytes at 16-bit).
|
||||
let original =
|
||||
AudioSamples::mono_16khz((0..100).map(|i| (i as f32) / 100.0).collect());
|
||||
let original = AudioSamples::mono_16khz((0..100).map(|i| (i as f32) / 100.0).collect());
|
||||
write_wav(&path, &original).unwrap();
|
||||
|
||||
// Drop the last 10 bytes — 5 samples' worth. hound's iterator
|
||||
|
||||
Reference in New Issue
Block a user