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

Slowdown problem when recording for long periods of time #2

Open
kdh-awraw1019 opened this issue Dec 16, 2024 · 2 comments
Open

Slowdown problem when recording for long periods of time #2

kdh-awraw1019 opened this issue Dec 16, 2024 · 2 comments

Comments

@kdh-awraw1019
Copy link

Hello

After running ez-sound-capture, I got this problem after recording for 24 hours.

I played a YouTube video for 24 hours, but the recording time was only 6 hours.

I also checked the memory through the task manager and found that it was taking up a significant percentage.

I ran the source code as is to directly observe this phenomenon.

How can I solve this problem so that I can record for a long time without any problems?

ez-sound-capture 이슈

@keisuke-okb
Copy link
Owner

Hello, and thank you for reporting this issue!

It seems that the recording process gradually slows down because all the recorded audio data is continuously stored in memory. To achieve stable recording, I think it will be necessary to improve memory handling, such as writing data to disk in fixed-sized chunks while recording.

In the meantime, please try the following:
There is a process at L.244 that backs up all audio data stored in memory every SETTINGS.recording.backup_interval (default: 60 secs). Try commenting out this line.

# threading.Thread(target=backup_data_every, args=(SETTINGS.recording.backup_interval, backup_dir), daemon=True).start()

However, please be aware that disabling this backup means the data will be lost if the Python program encounters an issue or is forcibly terminated.

I apologize for the limitations of this simple implementation. Please note that recording for extended durations, such as over an hour, may result in degraded performance or quality.

@kdh-awraw1019
Copy link
Author

I tried the method you suggested, but the problem was not solved.

However, when I compared the recorded audio file with the YouTube video, the beginning and the end sounded the same.

I felt it was necessary to find out why this was happening.

For example, the recorded frame(?) was compressed.

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

No branches or pull requests

2 participants