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

Make pyaudio optional #82

Merged
merged 10 commits into from
Sep 10, 2023
Merged

Make pyaudio optional #82

merged 10 commits into from
Sep 10, 2023

Conversation

dreinsch
Copy link
Member

@dreinsch dreinsch commented Aug 21, 2023

The goal of this PR is to make the pyaudio dependency optional (as extra pyaudio).

@dreinsch dreinsch self-assigned this Aug 21, 2023
Copy link
Member

@thomas-hermann thomas-hermann left a comment

Choose a reason for hiding this comment

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

I generally approve the move. I added 2 minor comments in the code.
As Jiajun has a deeper look into this topic, he should approve and merge.

pya/helper/helpers.py Outdated Show resolved Hide resolved
@@ -108,7 +107,7 @@ def _recorder_callback(self, in_data, frame_count, time_info, flag):
self.record_buffer.append(data_float)
# E = 10 * np.log10(np.mean(data_float ** 2)) # energy in dB
# os.write(1, f"\r{E} | {self.block_cnt}".encode())
return None, pyaudio.paContinue
return self.backend.process_buffer(None)
Copy link
Member

Choose a reason for hiding this comment

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

ok, maybe add a comment that process_buffer is called both for input and output streams

Copy link
Collaborator

@wiccy46 wiccy46 left a comment

Choose a reason for hiding this comment

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

Nice bit of change. Look sane to me apart from a minor issue. Looking forward to trying this out

tests/helpers.py Outdated Show resolved Hide resolved
@wiccy46 wiccy46 merged commit 8ff01d0 into develop Sep 10, 2023
8 checks passed
@wiccy46 wiccy46 deleted the refactor/make-pyaudio-optional branch September 10, 2023 11:39
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

Successfully merging this pull request may close these issues.

3 participants