Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 13 additions & 9 deletions ttt.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")

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.

Choose a reason for hiding this comment

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

Is this comment correct?

Choose a reason for hiding this comment

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

Is this comment helpful?

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?

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?

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?

ffmpeg_cmd = [
"ffmpeg",
"-y",
Expand All @@ -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",

Choose a reason for hiding this comment

The 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.

Choose a reason for hiding this comment

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

Is this comment correct?

Choose a reason for hiding this comment

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

Is this comment helpful?

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?

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?

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?

"8000",
"-vbr",
"on",
opusfile,
Comment on lines +236 to +243

Choose a reason for hiding this comment

The 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.

Choose a reason for hiding this comment

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

Is this comment correct?

Choose a reason for hiding this comment

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

Is this comment helpful?

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?

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?

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?

]
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():
Expand Down