Skip to main content

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.

  1. (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>
  2. Install package from pip:
    • Linux/osX: python3 -m pip install audio_cast
    • Windows: py -m pip install audio_cast
  3. Install required applications:
    1. 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
      • Windows: Install vlc from their website.
    2. (Only Linux/osX) Install libportaudio2: sudo apt install libportaudio2
  4. Install a WSGI server.
    • Waitress: pip install waitress
  5. Run WSGI server.
    • Example: waitress-serve --call --host=localhost --port=5000 'audio_cast:create_app'

Using apt (Linux)

Dev Usage

  • When using VS Code, just run the debugger.
  • Optional: Use a virtual environment.
  • When starting from termimal.
    1. Set environment variable for FLASK_APP to audio_cast.
      • Linux/osX: export set FLASK_APP=audio_cast
      • Windows cmd: set FLASK_APP=audio_cast
      • Windows powershell: $Env:FLASK_APP = "audio_cast"
    2. Launch the server with python -m flask run.

Cheatsheet

  • To upload to pypi:
    • Build: py -m build
    • Deploy: py -m twine upload dist/*
  • To run locally:
    • Set environment variable FLASK_APP=audio_cast
  • 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'
  • 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>
  • 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

  1. Install pip using apt sudo apt install python3-pip
  2. Install venv using apt sudo apt install python3-venv.
  3. Create virtual environment and activate it.
  4. Install waitress.
  5. Run waitress, run it without host so it is exposed.
  6. 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 and sudo apt install vlc-plugin-base. It's smaller but still big. Aroung 700MB.
    • Still there might be a better way.
  7. Install PortAudio using apt sudo apt install libportaudio2.

Project details


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.15.tar.gz (18.2 kB view details)

Uploaded Source

Built Distribution

audio_cast-0.0.15-py3-none-any.whl (19.5 kB view details)

Uploaded Python 3

File details

Details for the file audio-cast-0.0.15.tar.gz.

File metadata

  • Download URL: audio-cast-0.0.15.tar.gz
  • Upload date:
  • Size: 18.2 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

Hashes for audio-cast-0.0.15.tar.gz
Algorithm Hash digest
SHA256 f16cdc7cb390cae86cba6e94508e074505ae33033f40030b77891dc14275a993
MD5 4a916cae47a17e482fbad836ebd52dfe
BLAKE2b-256 6c33e85cd67af54149c4cf8ad7ca3c52b7cf6808137d5adf2ec8c140b79c039b

See more details on using hashes here.

File details

Details for the file audio_cast-0.0.15-py3-none-any.whl.

File metadata

  • Download URL: audio_cast-0.0.15-py3-none-any.whl
  • Upload date:
  • Size: 19.5 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

Hashes for audio_cast-0.0.15-py3-none-any.whl
Algorithm Hash digest
SHA256 a0956024edc6d5c64992fdeaef37a39518f932ff94d524be719d821a98da637e
MD5 e611e7934b9970a72df98c5216ef7332
BLAKE2b-256 75d2b9cdb923251821d89e35d2200d2bfc0149247e8daa349ff3e7bc8aad213e

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page