Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix/api-audio: Resolve Non-WAV Audio Streaming Issue #18

Merged
merged 4 commits into from
May 18, 2024
Merged

Conversation

mbsantiago
Copy link
Owner

This PR fixes a bug in the audio streaming API that prevented it from working with non-WAV files (FLAC, MP3) after the soundevent library upgrade to v2.

Technical Details

  • Problem: The existing audio streaming implementation relied on WAV-specific methods for extracting byte ranges from audio files. This caused failures when attempting to stream FLAC or MP3 files.
  • Solution: The audio chunk reading logic has been refactored to use a format-agnostic approach, ensuring compatibility with all audio formats supported by soundevent.
  • Testing: Unit tests have been added to verify correct streaming behavior for WAV, FLAC, and MP3 files.

Copy link

codecov bot commented May 18, 2024

Codecov Report

Attention: Patch coverage is 78.78788% with 7 lines in your changes are missing coverage. Please review.

Project coverage is 59.82%. Comparing base (1872486) to head (f178807).

Current head f178807 differs from pull request most recent head bf3d525

Please upload reports for the commit bf3d525 to get more accurate results.

Files Patch % Lines
back/src/whombat/api/audio.py 86.20% 4 Missing ⚠️
back/src/whombat/system/logging.py 33.33% 2 Missing ⚠️
back/src/whombat/routes/audio.py 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main      #18      +/-   ##
==========================================
- Coverage   59.83%   59.82%   -0.02%     
==========================================
  Files         171      171              
  Lines        7603     7596       -7     
==========================================
- Hits         4549     4544       -5     
+ Misses       3054     3052       -2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@mbsantiago mbsantiago merged commit 610c1c6 into main May 18, 2024
2 checks passed
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.

1 participant