removed --wav-only from calls clip cmd

quietlight
May 4, 2026, 7:46 PM
YUIQQPXYFEVTS4XG4N6JTKBHWC4OFWWSCGJ6MLNA6AWTKSYCSIEQC

Dependencies

Change contents

  • edit in tools/calls_clip_bench_test.go at line 302
    [4.572389][4.572389:572871]()
    }
    }
    func BenchmarkFullPipelineWavOnly(b *testing.B) {
    samples, sr, _ := utils.ReadWAVSamples(benchWAV)
    b.ResetTimer()
    b.ReportAllocs()
    for i := 0; i < b.N; i++ {
    segSamples := utils.ExtractSegmentSamples(samples, sr, 872, 895)
    outputSR := sr
    if sr > 16000 {
    segSamples = utils.ResampleRate(segSamples, sr, 16000)
    outputSR = 16000
    }
    f, _ := os.CreateTemp("", "bench_*.wav")
    utils.WriteWAVFile(f.Name(), segSamples, outputSR)
    f.Close()
    os.Remove(f.Name())
  • replacement in tools/calls_clip.go at line 18
    [4.574299][4.574299:574817]()
    File string `json:"file"`
    Folder string `json:"folder"`
    Output string `json:"output"`
    Prefix string `json:"prefix"`
    Filter string `json:"filter"`
    Species string `json:"species"`
    Certainty int `json:"certainty"`
    Size int `json:"size"`
    Color bool `json:"color"`
    WavOnly bool `json:"wav_only"`
    Night bool `json:"night"`
    Day bool `json:"day"`
    Lat float64 `json:"lat"`
    Lng float64 `json:"lng"`
    Timezone string `json:"timezone"`
    [4.574299]
    [4.574817]
    File string `json:"file"`
    Folder string `json:"folder"`
    Output string `json:"output"`
    Prefix string `json:"prefix"`
    Filter string `json:"filter"`
    Species string `json:"species"`
    Certainty int `json:"certainty"`
    Size int `json:"size"`
    Color bool `json:"color"`
    Night bool `json:"night"`
    Day bool `json:"day"`
    Lat float64 `json:"lat"`
    Lng float64 `json:"lng"`
    Timezone string `json:"timezone"`
  • replacement in tools/calls_clip.go at line 119
    [3.9459][3.9459:9688]()
    clips, skipped, errs := processFile(dataPath, input.Output, input.Prefix, input.Filter, speciesName, callType, input.Certainty, imgSize, input.Color, input.WavOnly, input.Night, input.Day, input.Lat, input.Lng, input.Timezone)
    [3.9459]
    [3.9688]
    clips, skipped, errs := processFile(dataPath, input.Output, input.Prefix, input.Filter, speciesName, callType, input.Certainty, imgSize, input.Color, input.Night, input.Day, input.Lat, input.Lng, input.Timezone)
  • replacement in tools/calls_clip.go at line 140
    [3.10291][3.10291:10522]()
    clips, skipped, errs := processFile(dataPath, input.Output, input.Prefix, input.Filter, speciesName, callType, input.Certainty, imgSize, input.Color, input.WavOnly, input.Night, input.Day, input.Lat, input.Lng, input.Timezone)
    [3.10291]
    [3.10522]
    clips, skipped, errs := processFile(dataPath, input.Output, input.Prefix, input.Filter, speciesName, callType, input.Certainty, imgSize, input.Color, input.Night, input.Day, input.Lat, input.Lng, input.Timezone)
  • replacement in tools/calls_clip.go at line 177
    [4.578883][4.578883:579087]()
    func processFile(dataPath, outputDir, prefix, filter, speciesName, callType string, certainty, imgSize int, color, wavOnly, night, day bool, lat, lng float64, timezone string) ([]string, int, []string) {
    [4.578883]
    [4.579087]
    func processFile(dataPath, outputDir, prefix, filter, speciesName, callType string, certainty, imgSize int, color, night, day bool, lat, lng float64, timezone string) ([]string, int, []string) {
  • replacement in tools/calls_clip.go at line 218
    [3.11613][3.11613:11749]()
    clips, errors = processSegments(matchingSegments, dataPath, samples, sampleRate, outputDir, prefix, basename, imgSize, color, wavOnly)
    [3.11613]
    [3.11749]
    clips, errors = processSegments(matchingSegments, dataPath, samples, sampleRate, outputDir, prefix, basename, imgSize, color)
  • replacement in tools/calls_clip.go at line 258
    [3.13058][3.13058:13251]()
    func processSegments(segments []*utils.Segment, dataPath string, samples []float64, sampleRate int, outputDir, prefix, basename string, imgSize int, color, wavOnly bool) ([]string, []string) {
    [3.13058]
    [3.13251]
    func processSegments(segments []*utils.Segment, dataPath string, samples []float64, sampleRate int, outputDir, prefix, basename string, imgSize int, color bool) ([]string, []string) {
  • replacement in tools/calls_clip.go at line 264
    [3.13351][4.580905:581042](),[4.580905][4.580905:581042]()
    clipFiles, err := generateClip(samples, sampleRate, outputDir, prefix, basename, seg.StartTime, seg.EndTime, imgSize, color, wavOnly)
    [3.13351]
    [4.581042]
    clipFiles, err := generateClip(samples, sampleRate, outputDir, prefix, basename, seg.StartTime, seg.EndTime, imgSize, color)
  • replacement in tools/calls_clip.go at line 272
    [4.581245][3.13352:13489]()
    clips, errors = processSegmentsParallel(segments, dataPath, samples, sampleRate, outputDir, prefix, basename, imgSize, color, wavOnly)
    [4.581245]
    [3.13489]
    clips, errors = processSegmentsParallel(segments, dataPath, samples, sampleRate, outputDir, prefix, basename, imgSize, color)
  • replacement in tools/calls_clip.go at line 279
    [3.13599][3.13599:13800]()
    func processSegmentsParallel(segments []*utils.Segment, dataPath string, samples []float64, sampleRate int, outputDir, prefix, basename string, imgSize int, color, wavOnly bool) ([]string, []string) {
    [3.13599]
    [3.13800]
    func processSegmentsParallel(segments []*utils.Segment, dataPath string, samples []float64, sampleRate int, outputDir, prefix, basename string, imgSize int, color bool) ([]string, []string) {
  • replacement in tools/calls_clip.go at line 293
    [3.14097][3.14097:14235]()
    clipFiles, err := generateClip(samples, sampleRate, outputDir, prefix, basename, seg.StartTime, seg.EndTime, imgSize, color, wavOnly)
    [3.14097]
    [3.14235]
    clipFiles, err := generateClip(samples, sampleRate, outputDir, prefix, basename, seg.StartTime, seg.EndTime, imgSize, color)
  • replacement in tools/calls_clip.go at line 326
    [4.582295][4.582295:582466]()
    func generateClip(samples []float64, sampleRate int, outputDir, prefix, basename string, startTime, endTime float64, imgSize int, color, wavOnly bool) ([]string, error) {
    [4.582295]
    [4.582466]
    func generateClip(samples []float64, sampleRate int, outputDir, prefix, basename string, startTime, endTime float64, imgSize int, color bool) ([]string, error) {
  • replacement in tools/calls_clip.go at line 350
    [4.583225][4.583225:583346]()
    // Generate spectrogram and PNG unless --wav-only
    if !wavOnly {
    pngPath := filepath.Join(outputDir, baseName+".png")
    [4.583225]
    [4.583346]
    pngPath := filepath.Join(outputDir, baseName+".png")
  • replacement in tools/calls_clip.go at line 352
    [4.583347][4.583347:583598]()
    spectSampleRate := outputSampleRate
    config := utils.DefaultSpectrogramConfig(spectSampleRate)
    spectrogram := utils.GenerateSpectrogram(segSamples, config)
    if spectrogram == nil {
    return nil, fmt.Errorf("failed to generate spectrogram")
    }
    [4.583347]
    [4.583598]
    spectSampleRate := outputSampleRate
    config := utils.DefaultSpectrogramConfig(spectSampleRate)
    spectrogram := utils.GenerateSpectrogram(segSamples, config)
    if spectrogram == nil {
    return nil, fmt.Errorf("failed to generate spectrogram")
    }
  • replacement in tools/calls_clip.go at line 359
    [4.583599][4.583599:583903]()
    // Create image (grayscale or color)
    var img image.Image
    if color {
    colorData := utils.ApplyL4Colormap(spectrogram)
    img = utils.CreateRGBImage(colorData)
    } else {
    img = utils.CreateGrayscaleImage(spectrogram)
    }
    if img == nil {
    return nil, fmt.Errorf("failed to create image")
    }
    [4.583599]
    [4.583903]
    // Create image (grayscale or color)
    var img image.Image
    if color {
    colorData := utils.ApplyL4Colormap(spectrogram)
    img = utils.CreateRGBImage(colorData)
    } else {
    img = utils.CreateGrayscaleImage(spectrogram)
    }
    if img == nil {
    return nil, fmt.Errorf("failed to create image")
    }
  • replacement in tools/calls_clip.go at line 371
    [4.583904][4.583904:583958]()
    resized := utils.ResizeImage(img, imgSize, imgSize)
    [4.583904]
    [4.583958]
    resized := utils.ResizeImage(img, imgSize, imgSize)
  • replacement in tools/calls_clip.go at line 373
    [4.583959][4.583959:584264]()
    // Write PNG (O_EXCL fails atomically if file exists)
    pngFile, err := os.OpenFile(pngPath, os.O_WRONLY|os.O_CREATE|os.O_EXCL, 0644)
    if err != nil {
    if os.IsExist(err) {
    return nil, fmt.Errorf("file already exists: %s", pngPath)
    }
    return nil, fmt.Errorf("failed to create PNG: %w", err)
    [4.583959]
    [4.584264]
    // Write PNG (O_EXCL fails atomically if file exists)
    pngFile, err := os.OpenFile(pngPath, os.O_WRONLY|os.O_CREATE|os.O_EXCL, 0644)
    if err != nil {
    if os.IsExist(err) {
    return nil, fmt.Errorf("file already exists: %s", pngPath)
  • replacement in tools/calls_clip.go at line 379
    [4.584268][4.584268:584549]()
    if err := utils.WritePNG(resized, pngFile); err != nil {
    _ = pngFile.Close()
    return nil, fmt.Errorf("failed to write PNG: %w", err)
    }
    if err := pngFile.Close(); err != nil {
    return nil, fmt.Errorf("failed to close PNG: %w", err)
    }
    files = append(files, pngPath)
    [4.584268]
    [4.584549]
    return nil, fmt.Errorf("failed to create PNG: %w", err)
    }
    if err := utils.WritePNG(resized, pngFile); err != nil {
    _ = pngFile.Close()
    return nil, fmt.Errorf("failed to write PNG: %w", err)
    }
    if err := pngFile.Close(); err != nil {
    return nil, fmt.Errorf("failed to close PNG: %w", err)
  • edit in tools/calls_clip.go at line 388
    [4.584552]
    [4.584552]
    files = append(files, pngPath)
  • edit in cmd/calls_clip.go at line 74
    [4.1134304][4.1134304:1134411]()
    fmt.Fprintf(os.Stderr, " --wav-only Generate only WAV clips, skip spectrogram PNG generation\n")
  • edit in cmd/calls_clip.go at line 108
    [2.27311][2.27311:27327]()
    wavOnly bool
  • edit in cmd/calls_clip.go at line 146
    [2.27854][4.16374:16383](),[4.1139138][4.16374:16383](),[4.16383][4.1139146:1139167](),[4.1139146][4.1139146:1139167](),[4.1139167][2.27855:27875]()
    p.i++
    case "--wav-only":
    f.wavOnly = true
  • edit in cmd/calls_clip.go at line 232
    [2.29139][2.29139:29163]()
    WavOnly: f.wavOnly,