A system to cast audio input to chromecast devices.
Project description
Application to cast streams to chromecast
Note: Designed to work with Rpi 4. Any installation process works for the Rpi4.
Production installation
Using pip (Windows/Linux/osX)
This requires to have python3
installed and pip
installed. Optionally also venv
.
- (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 required applications:
- Install vlc:
- Linux/osX has 2 alternatives:
- Install required libraries:
sudo apt install vlc-bin
sudo apt install vlc-plugin-base
- Install VLC
sudo apt install vlc
- Install required libraries:
- Windows: Install vlc from their website.
- Linux/osX has 2 alternatives:
- (Only Linux/osX) Install
libportaudio2
:sudo apt install libportaudio2
- Install vlc:
- 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:
Using apt (Linux)
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
Cheatsheet
- To upload to pypi:
- 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:
- Install packages from
requirements.txt
pip install -r requirements.txt
.
Next steps
- Run it in the Rpi
- Test if using the full name of the input device returned by the endpoint it works.
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 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.14.tar.gz
(17.4 kB
view details)
Built Distribution
File details
Details for the file audio-cast-0.0.14.tar.gz
.
File metadata
- Download URL: audio-cast-0.0.14.tar.gz
- Upload date:
- Size: 17.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | d3bef98a08e861e223fdaa19d593022fa6016ef5e89c4c599cf99b8d7519c156 |
|
MD5 | 8cc29ab4dfea764e00e2bad421fd7b6b |
|
BLAKE2b-256 | 880bd580c08bc351b3e15d5acd23e13183ed6ce85856ad38ec94186cf6af5f24 |
File details
Details for the file audio_cast-0.0.14-py3-none-any.whl
.
File metadata
- Download URL: audio_cast-0.0.14-py3-none-any.whl
- Upload date:
- Size: 18.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 856ea7b598138a68d093aab629681abd283e5d94f216d6cbffcc0430b1543105 |
|
MD5 | b8dbf451df987bc289f86b7b0f1e6cb3 |
|
BLAKE2b-256 | d28d7da14eb6a22f3927807a15e2d571660e2960708e8d021927064cc15d210d |