Skip to content

Commit

Permalink
JSON inside python3
Browse files Browse the repository at this point in the history
  • Loading branch information
pablodz committed Jun 16, 2021
1 parent 3412a04 commit 1566fba
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 12 deletions.
2 changes: 1 addition & 1 deletion pipewire_python/__init__.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"""pipewire_python:
Python controller, player and recorder via pipewire's commands"""

__version__ = "0.0.4"
__version__ = "0.0.5"

import sys

Expand Down
9 changes: 0 additions & 9 deletions pipewire_python/pipewireAPICommands.json

This file was deleted.

11 changes: 9 additions & 2 deletions pipewire_python/pipewirecontroller.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,14 @@
import json

KEY_TO_REPLACE = "COMMAND_HERE"
PIPEWIRE_API_COMMANDS = {"play": ["pw-play", "COMMAND_HERE"],
"record": ["pw-record"],
"cat": "pw-cat",
"mon": "pw-mon",
"dot": "pw-dot",
"top": "pw-top",
"dump": "pw-dump"
}


class Player:
Expand All @@ -10,8 +18,7 @@ class Player:

def __init__(self):

with open("pipewire_python/pipewireAPICommands.json", "r") as json_file:
self.commands_json = json.load(json_file)
self.commands_json =PIPEWIRE_API_COMMANDS

def play_WAV_File(self, audio_path):
"""
Expand Down
5 changes: 5 additions & 0 deletions tutorial.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
from pipewire_python.pipewirecontroller import Player


player=Player()
player.play_WAV_File('../docs/beers.wav')

0 comments on commit 1566fba

Please sign in to comment.