-
Notifications
You must be signed in to change notification settings - Fork 0
Return to opus. It just works better #64
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", | ||
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. question (code_clarification): Clarify the choice of a 8000 Hz cutoff frequency for VoIP application. The cutoff frequency of 8000 Hz is typical for telephony but might not be suitable for all VoIP applications, especially those requiring higher audio quality. 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? 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 helpful? 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 the comment type correct? 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 the comment area correct? 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. Should this comment become an LLM test? |
||
"8000", | ||
"-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 PR introduces new options for the ffmpeg command (e.g., '-application', '-cutoff', '-vbr'). It would be beneficial to add tests that verify these options are set correctly and that they produce the expected audio output quality and format. 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? 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 helpful? 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 the comment type correct? 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 the comment area correct? 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. Should this comment become an LLM test? |
||
] | ||
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 format conversion to .opus
The PR changes the audio format from .flac to .opus, but there are no tests to verify that the new format works as expected. Please add unit tests to ensure the conversion process to .opus is handled correctly and integrates well with the rest of the system.
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.
Is this comment correct?
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.
Is this comment helpful?
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.
Is the comment type correct?
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.
Is the comment area correct?
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.
Should this comment become an LLM test?