Skip to content

Let's try aac #61

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

Open
wants to merge 1 commit into
base: base-sha/885b37fc74790e45907c6e4d63240aa4a4aa758b
Choose a base branch
from
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
20 changes: 8 additions & 12 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)
"""
opusfile = Path(audiofile).with_suffix(".opus")
aacfile = Path(audiofile).with_suffix(".m4a")
ffmpeg_cmd = [
"ffmpeg",
"-y",
Expand All @@ -233,25 +233,21 @@ def audio_notification(audiofile, apobj, body, title):
"-filter:a",
"loudnorm=i=-14",
"-c:a",
"libopus",
"-application",
"voip",
"-cutoff",
"aac",
"-b",
"8000",
"-vbr",
"on",
opusfile,
aacfile,
Comment on lines +236 to +239

Choose a reason for hiding this comment

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

issue (performance): Review the AAC encoding parameters for correctness.

The bitrate '8000' seems unusually low for AAC audio, which might affect audio quality. Verify if this meets the intended quality requirements.

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)

opusfile = str(opusfile)
aacfile = str(aacfile)
apobj.notify(
body=body,
title=title,
attach=opusfile,
attach=aacfile,
)
# Remove opusfile; audiofile and json unlinked later
Path.unlink(opusfile)
# Remove aacfile; audiofile and json unlinked later
Path.unlink(aacfile)

Choose a reason for hiding this comment

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

suggestion (code_refinement): Use safer file deletion method to prevent potential data loss.

Consider checking if the file exists before attempting to unlink it to avoid raising an unnecessary exception.

Suggested change
Path.unlink(aacfile)
if aacfile.exists():
aacfile.unlink()

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?



def import_notification_destinations():
Expand Down