A system to cast audio input to chromecast devices.
Project description
Application to cast streams to chromecast
Dev Usage
- When using VS Code, just run the debugger.
- Optional: Use a virtual environment.
- When starting from termimal.
- Set environment variable for
FLASK_APP
toaudio_cast
.- Linux/osX:
export set FLASK_APP=audio_cast
- Windows cmd:
set FLASK_APP=audio_cast
- Windows powershell:
$Env:FLASK_APP = "audio_cast"
- Linux/osX:
- Launch the server with
python -m flask run
.
- Set environment variable for
Production installation
- (Optional) Create virtual environment to avoid dependency issues.
- Example using venv:
- Create:
python3 -m venv <DIR>
- Start: linux -
source <DIR>/bin/activate
- windows -<DIR>/Scripts/activate
- Stop:
deactivate
- To clear delete the directory and create again
rm -r <DIR>
- Create:
- Example using venv:
- Install package from pip:
- Linux/osX:
python3 -m pip install audio_cast
- Windows:
py -m pip install audio_cast
- Linux/osX:
- Install a WSGI server.
- Waitress:
pip install waitress
- Waitress:
- Run WSGI server.
- Example:
waitress-serve --call --host=localhost --port=5000 'audio_cast:create_app'
- Example:
Next steps
- Run it in the Rpi
- Fix sample.mp3 for testing purposes. How to package it? How to access it?
- Create directory for application data. Now it is stored where waitress is deployed.
- Check tutorial to upload package using apt.
- Enable CLI
- Check how to get inputs in linux using Rpi.
- Handle instance folder properly. Where should
known_devices.txt
be stored? What aboutsample.mp3
? - Decouple from full vlc and maybe use libvlc already bundled in the package?
Cheatsheet
- To upload:
- Build:
py -m build
- Deploy:
py -m twine upload dist/*
- Build:
- To run locally:
- Set environment variable
FLASK_APP=audio_cast
- Set environment variable
- To run after installation from package:
- Install waitress
python3 -m pip install waitress
- Run waitress
waitress-serve --call --host=localhost --port=5000 'audio_cast:create_app'
- Install waitress
- Virtual environment:
- Create:
python3 -m venv <DIR>
- Start: linux -
source <DIR>/bin/activate
- windows -<DIR>/Scripts/activate
- Stop:
deactivate
- To clear delete the directory and create again
rm -r <DIR>
- Create:
- Token for Pypi is in the local projects folder.
- Install packages from
requirements.txt
pip install -r requirements.txt
.
Rpi steps
- Install pip using apt
sudo apt install python3-pip
- Install venv using apt
sudo apt install python3-venv
. - Create virtual environment and activate it.
- Install waitress.
- Run waitress, run it without host so it is exposed.
- Install vlc
sudo apt install vlc
- Hopefully this can be changed to either incorporating the libvlc libraries or installing a part of vlc. Right now it's around 1 gb, which seems too much for the use needed.
- Or install vlc-bin and vlc-plugin-base.
sudo apt install vlc-bin
andsudo apt install vlc-plugin-base
. It's smaller but still big. Aroung 700MB. - Still there might be a better way.
- Install sounddevice from pip.
- Install PortAudio using apt
sudo apt install libportaudio2
.
Changes
- Changed endpoint names.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
audio-cast-0.0.11.tar.gz
(5.3 MB
view hashes)
Built Distribution
Close
Hashes for audio_cast-0.0.11-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a5a12250883e70cb876344cb7c0f2c2bb7a263e903240b34b5f46ee5a701eebb |
|
MD5 | fcf04da07792c3e581cf78b169b24627 |
|
BLAKE2b-256 | 740afa027fcf53edd6aa51c8ab4b6dd86ef175c912b9814886ab1d3a744d6219 |