piwave 2.0.3__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,219 @@
1
+ Metadata-Version: 2.4
2
+ Name: piwave
3
+ Version: 2.0.3
4
+ Summary: A python module to broacast radio waves with your Raspberry Pi.
5
+ Home-page: https://github.com/douxxtech/piwave
6
+ Author: Douxx
7
+ Author-email: douxx@douxx.tech
8
+ Project-URL: Bug Reports, https://github.com/douxxtech/piwave/issues
9
+ Project-URL: Source, https://github.com/douxxtech/piwave
10
+ Keywords: raspberry pi,radio,fm,rds,streaming,audio,broadcast
11
+ Classifier: Programming Language :: Python :: 3
12
+ Classifier: License :: OSI Approved :: GNU General Public License v3 (GPLv3)
13
+ Classifier: Operating System :: POSIX :: Linux
14
+ Requires-Python: >=3.7
15
+ Description-Content-Type: text/markdown
16
+ License-File: LICENSE
17
+ Requires-Dist: pathlib
18
+ Provides-Extra: dev
19
+ Requires-Dist: pytest>=6.0; extra == "dev"
20
+ Requires-Dist: pytest-cov>=2.0; extra == "dev"
21
+ Requires-Dist: black>=22.0; extra == "dev"
22
+ Requires-Dist: flake8>=4.0; extra == "dev"
23
+ Dynamic: author
24
+ Dynamic: author-email
25
+ Dynamic: classifier
26
+ Dynamic: description
27
+ Dynamic: description-content-type
28
+ Dynamic: home-page
29
+ Dynamic: keywords
30
+ Dynamic: license-file
31
+ Dynamic: project-url
32
+ Dynamic: provides-extra
33
+ Dynamic: requires-dist
34
+ Dynamic: requires-python
35
+ Dynamic: summary
36
+
37
+ <div align=center>
38
+ <img alt="PiWave image" src="https://piwave.xyz/static/img/logo.png"/>
39
+ <h1>PiWave</h1>
40
+ </div>
41
+
42
+ **PiWave** is a Python module designed to manage and control your Raspberry Pi radio using the `pi_fm_rds` utility. It allows you to easily convert audio files to WAV format and broadcast them at a specified frequency with RDS (Radio Data System) support.
43
+
44
+ ## Features
45
+
46
+ - Converts audio files to WAV format.
47
+ - Broadcasts WAV files using the `pi_fm_rds` utility.
48
+ - Configurable broadcast frequency, PS (Program Service), RT (Radio Text), and PI (Program Identifier).
49
+ - Supports looping of playback.
50
+ - Detailed logging for debug mode.
51
+ - Supports streaming from URLs.
52
+ - Better error handling and event callbacks.
53
+ - Non-blocking playback with threading.
54
+ - Temporary file management for streamed content.
55
+
56
+ > [!NOTE]
57
+ > Are you looking for a minimal GUI for PiWave?
58
+ > Take a look at the [PiWave WebGUI](https://github.com/douxxtech/piwave-webgui)
59
+
60
+ ## Hardware Installation
61
+
62
+ To use PiWave for broadcasting, you need to set up the hardware correctly. This involves connecting an antenna or cable to the Raspberry Pi's GPIO pin.
63
+
64
+ 1. **Connect the Cable or Antenna**:
65
+ - Attach a cable or an antenna to GPIO 4 (Pin 7) on the Raspberry Pi.
66
+ - Ensure the connection is secure to avoid any broadcasting issues.
67
+
68
+ 2. **GPIO Pinout**:
69
+ - GPIO 4 (Pin 7) is used for the broadcasting signal.
70
+ - Ensure that the cable or antenna is properly connected to this pin for optimal performance.
71
+
72
+ ## Installation
73
+
74
+ > [!WARNING]
75
+ > **Warning**: Using PiWave involves broadcasting signals which may be subject to local regulations and laws. It is your responsibility to ensure that your use of PiWave complies with all applicable legal requirements and regulations in your area. Unauthorized use of broadcasting equipment may result in legal consequences, including fines or penalties.
76
+ >
77
+ > **Liability**: The author of PiWave is not responsible for any damage, loss, or legal issues that may arise from the use of this software. By using PiWave, you agree to accept all risks and liabilities associated with its operation and broadcasting capabilities.
78
+ >
79
+ > Please exercise caution and ensure you have the proper permissions and knowledge of the regulations before using PiWave for broadcasting purposes.
80
+
81
+ ### Auto Installer
82
+
83
+ For a quick and easy installation, you can use the auto installer script. Open a terminal and run:
84
+
85
+ ```bash
86
+ curl -sL https://setup.piwave.xyz/ | sudo bash
87
+ ```
88
+
89
+ This command will download and execute the installation script, setting up PiWave and its dependencies automatically.
90
+
91
+ > [!NOTE]
92
+ > To uninstall, use the following command:
93
+ > ```bash
94
+ > curl -sL https://setup.piwave.xyz/uninstall | sudo bash
95
+ > ```
96
+
97
+ ### Manual Installation
98
+
99
+ To install PiWave manually, follow these steps:
100
+
101
+ 1. **Clone the repository and install**:
102
+
103
+ ```bash
104
+ pip install git+https://github.com/douxxtech/piwave.git --break-system-packages
105
+ ```
106
+
107
+ 2. **Dependencies**:
108
+
109
+ PiWave requires the `ffmpeg` and `ffprobe` utilities for file conversion and duration extraction. Install them using:
110
+
111
+ ```bash
112
+ sudo apt-get install ffmpeg
113
+ ```
114
+
115
+ 3. **PiFmRds**:
116
+
117
+ PiWave uses [PiFmRds](https://github.com/ChristopheJacquet/PiFmRds) to work. Make sure you have installed it before running PiWave.
118
+
119
+ ## Usage
120
+
121
+ ### Basic Usage
122
+
123
+ 1. **Importing the module**:
124
+
125
+ ```python
126
+ from piwave import PiWave
127
+ ```
128
+
129
+ 2. **Creating an instance**:
130
+
131
+ ```python
132
+ piwave = PiWave(
133
+ frequency=90.0,
134
+ ps="MyRadio",
135
+ rt="Playing great music",
136
+ pi="ABCD",
137
+ loop=True,
138
+ debug=True,
139
+ on_track_change=lambda file, index: print(f"Now playing: {file}"),
140
+ on_error=lambda error: print(f"Error occurred: {error}")
141
+ )
142
+ ```
143
+
144
+ 3. **Adding files to the playlist**:
145
+
146
+ ```python
147
+ files = ["path/to/your/audiofile.mp3", "http://example.com/stream.mp3"]
148
+ piwave.add_files(files)
149
+ ```
150
+
151
+ 4. **Starting playback**:
152
+
153
+ ```python
154
+ piwave.play() # or files = ["path/to/your/audiofile.mp3", "http://example.com/stream.mp3"]; piwave.play(files)
155
+ ```
156
+
157
+ 5. **Stopping playback**:
158
+
159
+ ```python
160
+ piwave.stop()
161
+ ```
162
+
163
+ 6. **Pausing and resuming playback**:
164
+
165
+ ```python
166
+ piwave.pause()
167
+ piwave.resume()
168
+ ```
169
+
170
+ 7. **Skipping tracks**:
171
+
172
+ ```python
173
+ piwave.next_track()
174
+ piwave.previous_track()
175
+ ```
176
+
177
+ 8. **Changing frequency**:
178
+
179
+ ```python
180
+ piwave.set_frequency(95.0)
181
+ ```
182
+
183
+ 9. **Getting status**:
184
+
185
+ ```python
186
+ status = piwave.get_status()
187
+ print(status)
188
+ ```
189
+
190
+ ### Configuration
191
+
192
+ - `frequency`: The broadcast frequency in MHz (default: 90.0).
193
+ - `ps`: Program Service name (up to 8 characters, default: "PiWave").
194
+ - `rt`: Radio Text (up to 64 characters, default: "PiWave: The best python module for managing your pi radio").
195
+ - `pi`: Program Identifier (up to 4 characters, default: "FFFF").
196
+ - `loop`: Whether to loop playback of files (default: False).
197
+ - `debug`: Enable detailed debug logging (default: False).
198
+ - `on_track_change`: Callback function when the track changes (default: None).
199
+ - `on_error`: Callback function when an error occurs (default: None).
200
+
201
+ ## Error Handling
202
+
203
+ - **Raspberry Pi Check**: The program verifies if it is running on a Raspberry Pi. It exits with an error message if not.
204
+ - **Root User Check**: The program requires root privileges to run. It exits with an error message if not run as root.
205
+ - **Executable Check**: The program automatically finds the `pi_fm_rds` executable or prompts the user to manually provide its path if it cannot be found.
206
+
207
+ ## License
208
+
209
+ PiWave is licensed under the GNU General Public License (GPL) v3.0. See the [LICENSE](LICENSE) file for more details.
210
+
211
+ ## Contributing
212
+
213
+ Contributions are welcome! Please submit a pull request or open an issue on [GitHub](https://github.com/douxxtech/piwave/issues) for any bugs or feature requests.
214
+
215
+ ---
216
+
217
+ Thank you for using PiWave!
218
+
219
+ Made with <3 by Douxx
@@ -0,0 +1,7 @@
1
+ piwave/__init__.py,sha256=lYEG0hZ7Khm0mMbVjVNLatI9YnKrHo_P5SWkN8eXmBk,50
2
+ piwave/piwave.py,sha256=oyxm0ggPtiHuca2TdsEjHN4hFAzRTVAnYEjaea0iQ-c,18031
3
+ piwave-2.0.3.dist-info/licenses/LICENSE,sha256=IwGE9guuL-ryRPEKi6wFPI_zOhg7zDZbTYuHbSt_SAk,35823
4
+ piwave-2.0.3.dist-info/METADATA,sha256=G8Z7lH8sSlwaIAiVwljZJrRwJx66m66FbZrhweBQ_vw,7041
5
+ piwave-2.0.3.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
6
+ piwave-2.0.3.dist-info/top_level.txt,sha256=xUbZ7Rk6OymSdDxmb9bfO8N-avJ9VYxP41GnXfwKYi8,7
7
+ piwave-2.0.3.dist-info/RECORD,,
@@ -0,0 +1,5 @@
1
+ Wheel-Version: 1.0
2
+ Generator: setuptools (80.9.0)
3
+ Root-Is-Purelib: true
4
+ Tag: py3-none-any
5
+