A Python library to generate EAS SAME Audio using Raw Data
Project description
A Fast Python EAS Generation Library
Features
- [x] EAS Generation
- [x] Individual Header, Attention Tone, and EOM Generation
- [x] Class and Inline Generation Scripts
- [x] Fast
- [x] PyDub AudioSegment Output for Easy Integration
- [x] Audio File Input for Audio Injection
- [x] FAST AS ALL HELL
Installation
This package should be installable through Pip.
On a Debian Based Linux OS:
sudo apt update
sudo apt install python3 python3-pip
pip3 install EASGen
On Windows:
In CMD:
python -m pip install EASGen
Usage
To generate a simple SAME Required Weekly Test:
from EASGen import EASGen
from pydub.playback import play
AlertManager = EASGen.EASGen()
header = "ZCZC-EAS-RWT-005007+0015-0010000-WACNTECH-" ## EAS Header to send
Alert = AlertManager.generateEASAudio(header=header, attentionTone=False, endOfMessage=True) ## Generate an EAS SAME message with no ATTN signal, and with EOMs.
play(Alert) ## Play the EAS Message
To use Inline Generation (Slower):
from EASGen.EASGen import EASGen
from pydub.playback import play
header = "ZCZC-EAS-RWT-005007+0015-0010000-WACNTECH-" ## EAS Header to send
Alert = EASGen.genEAS(header=header, attentionTone=False, endOfMessage=True) ## Generate an EAS SAME message with no ATTN signal, and with EOMs.
play(Alert) ## Play the EAS Message
To Insert Audio into an alert:
from EASGen.EASGen import EASGen
from pydub.playback import play
from pydub import AudioSegment
header = "ZCZC-CIV-DMO-033000+0100-0010000-WACNTECH-" ## EAS Header to send
audio = AudioSegment.from_wav("NewHampshireDMO.wav") ## Alert Audio import
Alert = EASGen.genEAS(header=header, attentionTone=True, audio=audio, endOfMessage=True) ## Generate an EAS SAME message with an ATTN signal, the imported WAV file as the audio, and with EOMs.
play(Alert) ## Play the EAS Message
## The New Hampshire State Police has activated the New Hampshire Emergency Alert System in order to conduct a practice demo. This concludes this test of the New Hampshire Emergency Alert System.
Spamming New Hampshire Demos have never been easier!
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
EASGen-0.1.2.tar.gz
(12.1 kB
view hashes)
Built Distribution
EASGen-0.1.2-py3-none-any.whl
(12.3 kB
view hashes)