A web application that announces stock prices at specified intervals using text-to-speech.
- Real-time stock price fetching using yfinance
- Browser-based audio announcements
- Configurable announcement intervals
- Clean, simple web interface
-
Install dependencies:
poetry install
-
Copy .env.example to .env and configure:
cp .env.example .env
-
Run the application:
poetry run python app.py
-
Open browser to http://localhost:5005
The application binds to 0.0.0.0 by default, making it accessible from other devices on your local network.
-
Find your computer's local IP address:
- macOS/Linux: Run
ifconfig | grep "inet "orhostname -I - Windows: Run
ipconfigand look for IPv4 Address
- macOS/Linux: Run
-
On another device (phone, tablet, another computer) connected to the same WiFi network, open a browser to:
http://YOUR_LOCAL_IP:5005For example:
http://192.168.1.100:5005 -
The audio will play on the device accessing the app, so you can have announcements on different devices throughout your home or office.
Security Note: This makes your app accessible to anyone on your local network. Don't expose port 5005 to the internet or use on untrusted networks.
- Enter a stock ticker symbol:
- Stocks: Use the standard symbol (e.g., AAPL, TSLA, MSFT)
- ETFs/Indices: Add a leading
^(e.g., ^XSP, ^SPX, ^GSPC)
- Set announcement interval in seconds (minimum 5, default 300 = 5 minutes)
- Click "Start Announcements"
- Listen to periodic price updates
- Toggle audio on/off using checkbox
- Click "Stop Announcements" when done
Due to iOS restrictions on programmatic audio playback, automatic announcements don't work on Mobile Safari. Instead:
- When a new price update arrives, you'll see "Tap to hear" in the display
- Tap the price display to play the announcement
- This ensures audio plays with direct user interaction, as required by iOS
Desktop browsers (Safari, Chrome, Firefox, Brave) play announcements automatically.
This application uses a shared ticker model - all connected browsers receive the same stock updates:
- When any browser starts announcements, all connected browsers receive those updates
- Starting a new ticker or changing the interval replaces the current ticker for all clients
- Each browser can independently enable/disable audio using the checkbox
- Think of it as a central stock price display board that multiple people can view
Use Cases:
- Multiple devices/screens in the same room showing the same stock
- Family members each viewing on their own device
- One person controlling the ticker, others just listening
Note: Per-client tracking (each browser tracking different tickers independently) could be added as a future enhancement.
- Python 3.10+
- Modern web browser with Web Speech API support
- Internet connection for fetching stock data
stock-audible/
├── app.py # Flask application with WebSocket handlers
├── config.py # Configuration management
├── stock_service.py # Stock data fetching logic
├── templates/
│ └── index.html # Web UI
└── static/
├── css/
│ └── style.css # Styling
└── js/
└── app.js # Frontend logic + TTS
