...
This commit is contained in:
parent
8ebd75744d
commit
38e3db9c82
1 changed files with 1 additions and 5 deletions
6
app.py
6
app.py
|
|
@ -4,15 +4,11 @@ import time
|
|||
from flask import Flask, abort, request, jsonify, g, url_for
|
||||
import jwt
|
||||
from pipewire_python import link
|
||||
from pipewire_python.controller import Controller
|
||||
|
||||
inputs = link.list_inputs()
|
||||
outputs = link.list_outputs()
|
||||
source = outputs[-1]
|
||||
sink = inputs[-1]
|
||||
audio_controller = Controller()
|
||||
interface = audio_controller.get_list_interfaces(type_interfaces="Client",filtered_by_type=True,)
|
||||
stream=interface[0]
|
||||
|
||||
# initialization
|
||||
app = Flask(__name__)
|
||||
|
|
@ -63,7 +59,7 @@ def disconnect():
|
|||
|
||||
@app.route('/api/volume/<float:vol>')
|
||||
def set_volume(vol):
|
||||
stream.set_config(volume=vol)
|
||||
source.set_config(volume=vol)
|
||||
return jsonify({'data': 'volume set'})
|
||||
|
||||
if __name__ == '__main__':
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue