Skip to content

Conversation

@Ardakilic
Copy link
Owner

@Ardakilic Ardakilic commented Sep 29, 2025

This PR fixes the ALAC bitrate parsing issue, so ALAC should be identified properly now.

Fixes #15


Note

Use ffprobe bits_per_raw_sample and parse first valid audio stream, skipping invalid/cover-art lines; update tests accordingly.

  • ALAC parsing:
    • Switch ffprobe field from bits_per_sample to bits_per_raw_sample in getALACInfo (both Docker and local).
    • Make parseALACInfo robust: iterate lines, validate rate/bit depth, enforce reasonable sample-rate bounds, and return the first valid audio stream; error if none.
  • Tests:
    • Update test to expect first valid audio stream among multiple lines.
    • Add case simulating cover art line following a valid audio stream.

Written by Cursor Bugbot for commit f4ebdb3. This will update automatically on new commits. Configure here.

@Ardakilic Ardakilic requested a review from Copilot September 29, 2025 03:44
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR fixes ALAC bitrate parsing by updating ffprobe arguments and improving stream selection logic to handle real-world ALAC files that may contain non-audio streams like cover art.

  • Updated ffprobe to use bits_per_raw_sample instead of bits_per_sample for more accurate ALAC bitrate detection
  • Enhanced parsing logic to iterate through multiple streams and select the first valid audio stream based on reasonable sample rate ranges
  • Added validation to skip non-audio streams and handle files with cover art or other metadata streams

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
main.go Updated ffprobe command arguments and implemented robust stream filtering logic
main_test.go Added test case for ALAC files with cover art and updated existing test description

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@Ardakilic Ardakilic merged commit 6919557 into main Sep 29, 2025
2 checks passed
@Ardakilic Ardakilic deleted the fix/alac branch September 29, 2025 03:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ALAC -> ALAC conversion Error: SoX conversion to FLAC failed: exit status 2

2 participants