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

Format code with black #16

Merged
merged 1 commit into from
Jan 11, 2023
Merged
Show file tree
Hide file tree
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
25 changes: 15 additions & 10 deletions tests/test_playback.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
from pipewire_python.controller import Controller

# import requests


Expand All @@ -13,15 +14,19 @@
# normal way
def test_playback():
audio_controller = Controller(verbose=True)
audio_controller.set_config(rate=384000,
channels=2,
_format='f64',
volume=0.98,
quality=4,
# Debug
verbose=True)
audio_controller.playback(audio_filename='docs/beers.wav',
# Debug
verbose=True)
audio_controller.set_config(
rate=384000,
channels=2,
_format="f64",
volume=0.98,
quality=4,
# Debug
verbose=True,
)
audio_controller.playback(
audio_filename="docs/beers.wav",
# Debug
verbose=True,
)

assert type(audio_controller.get_config())
10 changes: 6 additions & 4 deletions tests/test_record.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,10 @@

def test_record():
audio_controller = Controller(verbose=True)
audio_controller.record(audio_filename='1sec_record.wav',
timeout_seconds=1,
# Debug
verbose=True)
audio_controller.record(
audio_filename="1sec_record.wav",
timeout_seconds=1,
# Debug
verbose=True,
)
assert type(audio_controller.get_config())
35 changes: 21 additions & 14 deletions tutorial.py
Original file line number Diff line number Diff line change
@@ -1,21 +1,26 @@
from pipewire_python.controller import Controller

# import asyncio

#########################
# PLAYBACK #
#########################
# normal way
audio_controller = Controller(verbose=True)
audio_controller.set_config(rate=384000,
channels=2,
_format='f64',
volume=0.98,
quality=4,
# Debug
verbose=True)
audio_controller.playback(audio_filename='docs/beers.wav',
# Debug
verbose=True)
audio_controller.set_config(
rate=384000,
channels=2,
_format="f64",
volume=0.98,
quality=4,
# Debug
verbose=True,
)
audio_controller.playback(
audio_filename="docs/beers.wav",
# Debug
verbose=True,
)

# async way
# player = Player()
Expand All @@ -28,10 +33,12 @@

# normal way
audio_controller = Controller(verbose=True)
audio_controller.record(audio_filename='docs/5sec_record.wav',
timeout_seconds=5,
# Debug
verbose=True)
audio_controller.record(
audio_filename="docs/5sec_record.wav",
timeout_seconds=5,
# Debug
verbose=True,
)

# async way
# player = Player()
Expand Down