-
Notifications
You must be signed in to change notification settings - Fork 0
Return to opus. It just works better #71
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
base: base-sha/f331bc6f04aa29181c0af4416ff4c0c8aaee7a5e
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||||
---|---|---|---|---|---|---|---|---|---|---|
|
@@ -224,7 +224,7 @@ def audio_notification(audiofile, apobj, body, title): | |||||||||
Examples: | ||||||||||
audio_notification(audiofile, apobj, body, title) | ||||||||||
""" | ||||||||||
flacfile = Path(audiofile).with_suffix(".flac") | ||||||||||
opusfile = Path(audiofile).with_suffix(".opus") | ||||||||||
ffmpeg_cmd = [ | ||||||||||
"ffmpeg", | ||||||||||
"-y", | ||||||||||
|
@@ -233,21 +233,25 @@ def audio_notification(audiofile, apobj, body, title): | |||||||||
"-filter:a", | ||||||||||
"loudnorm=i=-14", | ||||||||||
"-c:a", | ||||||||||
"flac", | ||||||||||
flacfile, | ||||||||||
"-compression_level", | ||||||||||
"12", | ||||||||||
"libopus", | ||||||||||
"-application", | ||||||||||
"voip", | ||||||||||
"-cutoff", | ||||||||||
"8000", | ||||||||||
Comment on lines
+239
to
+240
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. suggestion (performance): Review the '8000' Hz cutoff frequency for appropriateness in the VOIP context. The cutoff frequency of 8000 Hz might not be suitable for all VOIP applications, especially if high-quality audio is required. Consider if a higher cutoff might be necessary.
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is this comment correct? |
||||||||||
"-vbr", | ||||||||||
"on", | ||||||||||
opusfile, | ||||||||||
Comment on lines
+236
to
+243
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. suggestion (testing): Consider adding tests for new ffmpeg command options. The addition of new options like 'libopus', 'voip', 'cutoff', '8000', and 'vbr' in the ffmpeg command suggests a need for tests to verify that these settings are correctly applied and function as intended. |
||||||||||
] | ||||||||||
subprocess.run(ffmpeg_cmd, check=True, capture_output=True) | ||||||||||
|
||||||||||
flacfile = str(flacfile) | ||||||||||
opusfile = str(opusfile) | ||||||||||
apobj.notify( | ||||||||||
body=body, | ||||||||||
title=title, | ||||||||||
attach=flacfile, | ||||||||||
attach=opusfile, | ||||||||||
) | ||||||||||
# Remove flacfile; audiofile and json unlinked later | ||||||||||
Path.unlink(flacfile) | ||||||||||
# Remove opusfile; audiofile and json unlinked later | ||||||||||
Path.unlink(opusfile) | ||||||||||
|
||||||||||
|
||||||||||
def import_notification_destinations(): | ||||||||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
suggestion (testing): Missing test for the new audio file format change.
The change from FLAC to OPUS format should be accompanied by a test to ensure the new format is handled correctly and that the audio quality meets the expected standards.