Init repo
This commit is contained in:
14
app/pulse.py
Normal file
14
app/pulse.py
Normal file
@@ -0,0 +1,14 @@
|
||||
from fastapi import APIRouter
|
||||
import subprocess
|
||||
import os
|
||||
|
||||
router = APIRouter()
|
||||
|
||||
pulse_process = subprocess.Popen("pulseaudio --daemonize=no --system --realtime --log-target=journal", shell=True, preexec_fn=os.setsid)
|
||||
|
||||
@router.get("/status")
|
||||
async def get_status():
|
||||
return {"status": "running" if pulse_process else "stopped"}
|
||||
|
||||
|
||||
# subprocess.Popen(os.path.join(OP25_PATH, OP25_SCRIPT), shell=True, preexec_fn=os.setsid, cwd=OP25_PATH)
|
||||
Reference in New Issue
Block a user