cysox 0.1.5__cp39-cp39-manylinux_2_27_x86_64.manylinux_2_28_x86_64.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,339 @@
1
+ Metadata-Version: 2.4
2
+ Name: cysox
3
+ Version: 0.1.5
4
+ Summary: A Pythonic audio processing library wrapping libsox
5
+ Author-email: Shakeeb Alireza <shakfu@users.noreply.github.com>
6
+ Maintainer-email: Shakeeb Alireza <shakfu@users.noreply.github.com>
7
+ License-Expression: MIT
8
+ Project-URL: Homepage, https://github.com/shakfu/cysox
9
+ Project-URL: Repository, https://github.com/shakfu/cysox
10
+ Project-URL: Documentation, https://github.com/shakfu/cysox#readme
11
+ Project-URL: Issues, https://github.com/shakfu/cysox/issues
12
+ Project-URL: Changelog, https://github.com/shakfu/cysox/releases
13
+ Keywords: audio,sound,sox,libsox,audio-processing,effects,cython,dsp
14
+ Classifier: Development Status :: 4 - Beta
15
+ Classifier: Intended Audience :: Developers
16
+ Classifier: Intended Audience :: Science/Research
17
+ Classifier: Operating System :: MacOS
18
+ Classifier: Operating System :: POSIX :: Linux
19
+ Classifier: Programming Language :: Cython
20
+ Classifier: Programming Language :: Python :: 3
21
+ Classifier: Programming Language :: Python :: 3.9
22
+ Classifier: Programming Language :: Python :: 3.10
23
+ Classifier: Programming Language :: Python :: 3.11
24
+ Classifier: Programming Language :: Python :: 3.12
25
+ Classifier: Programming Language :: Python :: 3.13
26
+ Classifier: Programming Language :: Python :: 3.14
27
+ Classifier: Topic :: Multimedia :: Sound/Audio
28
+ Classifier: Topic :: Multimedia :: Sound/Audio :: Analysis
29
+ Classifier: Topic :: Multimedia :: Sound/Audio :: Conversion
30
+ Classifier: Topic :: Multimedia :: Sound/Audio :: Editors
31
+ Classifier: Topic :: Multimedia :: Sound/Audio :: Sound Synthesis
32
+ Classifier: Typing :: Typed
33
+ Requires-Python: >=3.9
34
+ Description-Content-Type: text/markdown
35
+ License-File: LICENSE
36
+ Dynamic: license-file
37
+
38
+ # cysox
39
+
40
+ [![PyPI](https://img.shields.io/pypi/v/cysox)](https://pypi.org/project/cysox/)
41
+ [![Python](https://img.shields.io/pypi/pyversions/cysox)](https://pypi.org/project/cysox/)
42
+ [![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](LICENSE)
43
+
44
+ A Pythonic audio processing library which uses cython to wrap [libsox](https://github.com/chirlu/sox).
45
+
46
+ ## Features
47
+
48
+ - **Simple API**: Convert, analyze, and play audio with one-liners
49
+ - **Typed Effects**: 28 effect classes with IDE autocomplete and validation
50
+ - **High Performance**: Direct C bindings through Cython
51
+ - **Zero Configuration**: Auto-initialization, no manual setup required
52
+ - **Cross-Platform**: macOS, Linux (Windows placeholder)
53
+
54
+ ## Installation
55
+
56
+ Note that cysox only works on macOS and Linux.
57
+
58
+ ```sh
59
+ pip install cysox
60
+ ```
61
+
62
+ ## Command Line Interface
63
+
64
+ ```sh
65
+ # Show version
66
+ cysox --version
67
+
68
+ # Get audio file info
69
+ cysox info audio.wav
70
+
71
+ # Convert audio files
72
+ cysox convert input.wav output.mp3
73
+ cysox convert input.wav output.wav --rate 48000 --channels 1
74
+
75
+ # Play audio
76
+ cysox play audio.wav
77
+
78
+ # Concatenate files
79
+ cysox concat intro.wav main.wav outro.wav -o full.wav
80
+ ```
81
+
82
+ ## Quick Start
83
+
84
+ ```python
85
+ import cysox
86
+ from cysox import fx
87
+
88
+ # Get audio file info
89
+ info = cysox.info('audio.wav')
90
+ print(f"Duration: {info['duration']:.2f}s, Sample rate: {info['sample_rate']} Hz")
91
+
92
+ # Convert with effects
93
+ cysox.convert('input.wav', 'output.mp3', effects=[
94
+ fx.Normalize(),
95
+ fx.Reverb(reverberance=60),
96
+ fx.Fade(fade_in=0.5, fade_out=1.0),
97
+ ])
98
+
99
+ # Play audio (macOS/Linux)
100
+ cysox.play('audio.wav')
101
+
102
+ # Play with effects
103
+ cysox.play('audio.wav', effects=[fx.Volume(db=-6)])
104
+ ```
105
+
106
+ ## Core Functions
107
+
108
+ ### `cysox.info(path) -> dict`
109
+
110
+ Get audio file metadata:
111
+
112
+ ```python
113
+ info = cysox.info('audio.wav')
114
+ # Returns: {
115
+ # 'path': 'audio.wav',
116
+ # 'format': 'wav',
117
+ # 'duration': 11.5,
118
+ # 'sample_rate': 44100,
119
+ # 'channels': 2,
120
+ # 'bits_per_sample': 16,
121
+ # 'samples': 507150,
122
+ # 'encoding': 'signed-integer',
123
+ # }
124
+ ```
125
+
126
+ ### `cysox.convert(input, output, effects=[], **options)`
127
+
128
+ Convert audio files with optional effects and format options:
129
+
130
+ ```python
131
+ # Simple format conversion
132
+ cysox.convert('input.wav', 'output.mp3')
133
+
134
+ # With effects
135
+ cysox.convert('input.wav', 'output.wav', effects=[
136
+ fx.Volume(db=3),
137
+ fx.Bass(gain=5),
138
+ fx.Reverb(),
139
+ ])
140
+
141
+ # With format options
142
+ cysox.convert('input.wav', 'output.wav',
143
+ sample_rate=48000,
144
+ channels=1,
145
+ bits=24,
146
+ )
147
+ ```
148
+
149
+ ### `cysox.stream(path, chunk_size=8192) -> Iterator[memoryview]`
150
+
151
+ Stream audio samples for processing:
152
+
153
+ ```python
154
+ import numpy as np
155
+
156
+ for chunk in cysox.stream('large.wav', chunk_size=8192):
157
+ arr = np.frombuffer(chunk, dtype=np.int32)
158
+ process(arr)
159
+ ```
160
+
161
+ ### `cysox.play(path, effects=[])`
162
+
163
+ Play audio to the default audio device:
164
+
165
+ ```python
166
+ cysox.play('audio.wav')
167
+ cysox.play('audio.wav', effects=[fx.Volume(db=-6), fx.Reverb()])
168
+ ```
169
+
170
+ ### `cysox.concat(inputs, output)`
171
+
172
+ Concatenate multiple audio files:
173
+
174
+ ```python
175
+ cysox.concat(['intro.wav', 'main.wav', 'outro.wav'], 'full.wav')
176
+ ```
177
+
178
+ All input files must have the same sample rate and channel count.
179
+
180
+ ## Effects Module
181
+
182
+ The `cysox.fx` module provides 28 typed effect classes:
183
+
184
+ ### Volume & Dynamics
185
+ ```python
186
+ fx.Volume(db=3) # Adjust volume in dB
187
+ fx.Gain(db=6) # Apply gain
188
+ fx.Normalize(level=-3) # Normalize to target level
189
+ ```
190
+
191
+ ### Equalization
192
+ ```python
193
+ fx.Bass(gain=5, frequency=100) # Boost/cut bass
194
+ fx.Treble(gain=-2, frequency=3000) # Boost/cut treble
195
+ fx.Equalizer(frequency=1000, width=1.0, gain=3)
196
+ ```
197
+
198
+ ### Filters
199
+ ```python
200
+ fx.HighPass(frequency=200) # Remove low frequencies
201
+ fx.LowPass(frequency=8000) # Remove high frequencies
202
+ fx.BandPass(frequency=1000, width=100)
203
+ fx.BandReject(frequency=60, width=10) # Notch filter
204
+ ```
205
+
206
+ ### Spatial & Reverb
207
+ ```python
208
+ fx.Reverb(reverberance=50, room_scale=100)
209
+ fx.Echo(gain_in=0.8, gain_out=0.9, delays=[100], decays=[0.5])
210
+ fx.Chorus()
211
+ fx.Flanger()
212
+ ```
213
+
214
+ ### Time-Based
215
+ ```python
216
+ fx.Trim(start=1.0, end=5.0) # Extract portion
217
+ fx.Pad(before=0.5, after=1.0) # Add silence
218
+ fx.Speed(factor=1.5) # Change speed (affects pitch)
219
+ fx.Tempo(factor=1.5) # Change tempo (preserves pitch)
220
+ fx.Pitch(cents=100) # Shift pitch (preserves tempo)
221
+ fx.Reverse() # Reverse audio
222
+ fx.Fade(fade_in=0.5, fade_out=1.0) # Fade in/out
223
+ fx.Repeat(count=3) # Repeat audio
224
+ ```
225
+
226
+ ### Conversion
227
+ ```python
228
+ fx.Rate(sample_rate=48000) # Resample
229
+ fx.Channels(channels=1) # Change channel count
230
+ fx.Remix(out_spec=[[1, 2]]) # Custom channel mixing
231
+ fx.Dither() # Add dither
232
+ ```
233
+
234
+ ### Composite Effects
235
+
236
+ Create reusable effect combinations:
237
+
238
+ ```python
239
+ from cysox.fx import CompositeEffect, HighPass, LowPass, Reverb, Volume
240
+
241
+ class TelephoneEffect(CompositeEffect):
242
+ """Simulate telephone audio quality."""
243
+
244
+ @property
245
+ def effects(self):
246
+ return [
247
+ HighPass(frequency=300),
248
+ LowPass(frequency=3400),
249
+ Volume(db=-3),
250
+ ]
251
+
252
+ # Use like any other effect
253
+ cysox.convert('input.wav', 'output.wav', effects=[TelephoneEffect()])
254
+ ```
255
+
256
+ ## Low-Level API
257
+
258
+ For advanced use cases, access the full libsox bindings:
259
+
260
+ ```python
261
+ from cysox import sox
262
+
263
+ # Manual initialization (high-level API handles this automatically)
264
+ sox.init()
265
+
266
+ # Open files
267
+ input_fmt = sox.Format('input.wav')
268
+ output_fmt = sox.Format('output.wav', signal=input_fmt.signal, mode='w')
269
+
270
+ # Build effects chain
271
+ chain = sox.EffectsChain(input_fmt.encoding, output_fmt.encoding)
272
+
273
+ e = sox.Effect(sox.find_effect("input"))
274
+ e.set_options([input_fmt])
275
+ chain.add_effect(e, input_fmt.signal, input_fmt.signal)
276
+
277
+ e = sox.Effect(sox.find_effect("vol"))
278
+ e.set_options(["3dB"])
279
+ chain.add_effect(e, input_fmt.signal, input_fmt.signal)
280
+
281
+ e = sox.Effect(sox.find_effect("output"))
282
+ e.set_options([output_fmt])
283
+ chain.add_effect(e, input_fmt.signal, input_fmt.signal)
284
+
285
+ # Process
286
+ chain.flow_effects()
287
+
288
+ # Cleanup
289
+ input_fmt.close()
290
+ output_fmt.close()
291
+ sox.quit()
292
+ ```
293
+
294
+ ## Building from Source
295
+
296
+ ### macOS
297
+
298
+ ```sh
299
+ brew install sox libsndfile mad libpng flac lame mpg123 libogg opus opusfile libvorbis
300
+ make
301
+ make test
302
+ ```
303
+
304
+ ### Linux
305
+
306
+ ```sh
307
+ sudo apt-get install libsox-dev libsndfile1-dev pkg-config
308
+ make
309
+ make test
310
+ ```
311
+
312
+ ## Status
313
+
314
+ Comprehensive test suite covering all functionality. All libsox C examples ported to Python (effects chains, waveform analysis, trim, concatenation, format conversion).
315
+
316
+ ## Known Issues
317
+
318
+ - **Memory I/O**: libsox memory I/O functions have platform issues (tests skipped)
319
+ - **Init/Quit Cycles**: Use high-level API to avoid init/quit issues (handled automatically)
320
+
321
+ See [KNOWN_LIMITATIONS.md](https://github.com/shakfu/cysox/blob/main/KNOWN_LIMITATIONS.md) for details.
322
+
323
+ ## Platform Support
324
+
325
+ - **macOS**: Full support
326
+ - **Linux**: Full support
327
+ - **Windows**: Placeholder (contributions welcome)
328
+
329
+ ## Building Documentation
330
+
331
+ ```sh
332
+ pip install sphinx furo myst-parser
333
+ make docs
334
+ make docs-serve # http://localhost:8000
335
+ ```
336
+
337
+ ## License
338
+
339
+ MIT
@@ -0,0 +1,27 @@
1
+ cysox/__init__.py,sha256=RkTzTu736ApFJJjQbnqfdVWfvxFxKvljGD01ZmKkMhI,1151
2
+ cysox/__init__.pyi,sha256=zTHi-vJdVHfpp4C7eO7JxODJ3fH4pVJXz8vh5y-K_0g,5738
3
+ cysox/__main__.py,sha256=qJDBNa3EDI-qWlr6eRQL2w4wxKqH3Fjy_5yq4ThpfQY,3147
4
+ cysox/audio.py,sha256=xLs-3N4l5sZw55tKS44DoQAxvFBXwp8cx0h9EMg4ORE,16352
5
+ cysox/sox.cpython-39-x86_64-linux-gnu.so,sha256=4unGZJulY6Z5mG5ONWJtZT2XyhHjwERo9lGNtAdkO0M,4634257
6
+ cysox/utils.py,sha256=PAwDschsI8ExnkQRFtuVrhF0E3sz6Jn70ROSfWHyc6A,1799
7
+ cysox/utils.pyi,sha256=JyDetZf6yE9rJYDkKW2UFHOIRNsQ5sm73X94pQm7Rok,633
8
+ cysox/fx/__init__.py,sha256=d2qqmcYnWf_zwlbAKVJ4aoWNkEXCsM4RS5CGxje8HOE,1618
9
+ cysox/fx/base.py,sha256=J3r0VlDue7zMyuwkQBuASl_xpADn1cVKO_q3H0BhgJA,4749
10
+ cysox/fx/convert.py,sha256=CuK_I7yy8yQv4bYjhk52FJAcnR9hKGj4nIUZMERyATs,3499
11
+ cysox/fx/eq.py,sha256=Sx6Ot1o5pIbQhYbLoIf_MIGcR5H12CCYo9nuazmkrjc,2363
12
+ cysox/fx/filter.py,sha256=yp6jxwnuCrNiT8npHNgzYrWCscOTO3ZBlsoKOW-4hQk,3625
13
+ cysox/fx/reverb.py,sha256=GmfnCB9tEbr24t1fk1Buk6RjBq6_fAGkSBlVgkXMm2w,6193
14
+ cysox/fx/time.py,sha256=Zu-O85zqo4IBgtxh9kV7ucS9j-TOiQELZ_OaG4M3u2c,6618
15
+ cysox/fx/volume.py,sha256=iZZ2bQEIfYSa20i8tpQHGx5MenMjVNwO6hozxKMiQ0Y,2302
16
+ cysox.libs/libgomp-e985bcbb.so.1.0.0,sha256=pDkE5PopcwHUZA3BuzyKNIC0BvmeSY66mxkUtoqrYEo,253289
17
+ cysox.libs/libgsm-6a620b60.so.1.0.17,sha256=HnBXjjid9UZ5ojm6pgtQAJKt8gMIcBm3iFZcyRpOyfM,58649
18
+ cysox.libs/libltdl-dfe8b62f.so.7,sha256=m4lVMxIhbYgPB_yNb8qUaHJCLJGfaArfeCSWhFpHGvI,41121
19
+ cysox.libs/libpng16-2bf8e833.so.16.34.0,sha256=DC6obCG3a-WS4YUzNInyeBz0oGdqGjdSiHV9Ctyzz1k,232865
20
+ cysox.libs/libsox-36efe91a.so.3.0.0,sha256=hO4jFE3e_Zzuw6gO_2Pech6DxA2zHI8CoXx73PQPq1o,834513
21
+ cysox-0.1.5.dist-info/METADATA,sha256=C8g8qm5WB9h9jX5YLSZpji6WIhNYHlXPeu9xu7JAc7c,8743
22
+ cysox-0.1.5.dist-info/WHEEL,sha256=v7ccuw7ENzL5TQ6J27AHIIY_nE__EkpSwTZN_nic4QA,149
23
+ cysox-0.1.5.dist-info/entry_points.txt,sha256=PXkM25bosHowrhva4PFL5UcdtQpGAHEGWOiyAZdFxBc,46
24
+ cysox-0.1.5.dist-info/top_level.txt,sha256=n90tvFrptqXw-CXvLdfcV9ylNEgonvH76ccV_7udOpg,6
25
+ cysox-0.1.5.dist-info/RECORD,,
26
+ cysox-0.1.5.dist-info/licenses/LICENSE,sha256=4rD5kJP4PQ65iwMQtTXEF3f95ZgTo6cD4E68H4v9mqE,1072
27
+ cysox-0.1.5.dist-info/sboms/auditwheel.cdx.json,sha256=raeD-9F395DX8z9S-YL_pobDHIFM_hlFgiYD4qGcCEM,2743
@@ -0,0 +1,6 @@
1
+ Wheel-Version: 1.0
2
+ Generator: setuptools (80.10.1)
3
+ Root-Is-Purelib: false
4
+ Tag: cp39-cp39-manylinux_2_27_x86_64
5
+ Tag: cp39-cp39-manylinux_2_28_x86_64
6
+
@@ -0,0 +1,2 @@
1
+ [console_scripts]
2
+ cysox = cysox.__main__:main
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 Shakeeb Alireza
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1 @@
1
+ {"bomFormat": "CycloneDX", "specVersion": "1.4", "version": 1, "metadata": {"component": {"type": "library", "bom-ref": "pkg:pypi/cysox@0.1.5?file_name=cysox-0.1.5-cp39-cp39-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl", "name": "cysox", "version": "0.1.5", "purl": "pkg:pypi/cysox@0.1.5?file_name=cysox-0.1.5-cp39-cp39-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl"}, "tools": [{"name": "auditwheel", "version": "6.5.0"}]}, "components": [{"type": "library", "bom-ref": "pkg:pypi/cysox@0.1.5?file_name=cysox-0.1.5-cp39-cp39-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl", "name": "cysox", "version": "0.1.5", "purl": "pkg:pypi/cysox@0.1.5?file_name=cysox-0.1.5-cp39-cp39-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl"}, {"type": "library", "bom-ref": "pkg:rpm/almalinux/gsm@1.0.17-5.el8#576c6df5b8c2e212f6ae988c74da1d0f103c388063d37feb25f7392bddf3986f", "name": "gsm", "version": "1.0.17-5.el8", "purl": "pkg:rpm/almalinux/gsm@1.0.17-5.el8"}, {"type": "library", "bom-ref": "pkg:rpm/almalinux/sox@14.4.2.0-29.el8#712c0d355206b77431db4488d00b0a2d10d3c4b5dfa6196e1637d6238d28af00", "name": "sox", "version": "14.4.2.0-29.el8", "purl": "pkg:rpm/almalinux/sox@14.4.2.0-29.el8"}, {"type": "library", "bom-ref": "pkg:rpm/almalinux/libpng@1.6.34-9.el8_10#570812db8ef1fc54050fb57a74e7f468cba961a6a9ab4bcd175ead818e7c5bfa", "name": "libpng", "version": "1.6.34-9.el8_10", "purl": "pkg:rpm/almalinux/libpng@1.6.34-9.el8_10"}, {"type": "library", "bom-ref": "pkg:rpm/almalinux/libgomp@8.5.0-28.el8_10.alma.1#c61017c9a24eb6e1e1a3cdc9becd004a6419cbda3d54b4848b98f240a4829571", "name": "libgomp", "version": "8.5.0-28.el8_10.alma.1", "purl": "pkg:rpm/almalinux/libgomp@8.5.0-28.el8_10.alma.1"}], "dependencies": [{"ref": "pkg:pypi/cysox@0.1.5?file_name=cysox-0.1.5-cp39-cp39-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl", "dependsOn": ["pkg:rpm/almalinux/gsm@1.0.17-5.el8#576c6df5b8c2e212f6ae988c74da1d0f103c388063d37feb25f7392bddf3986f", "pkg:rpm/almalinux/sox@14.4.2.0-29.el8#712c0d355206b77431db4488d00b0a2d10d3c4b5dfa6196e1637d6238d28af00", "pkg:rpm/almalinux/libpng@1.6.34-9.el8_10#570812db8ef1fc54050fb57a74e7f468cba961a6a9ab4bcd175ead818e7c5bfa", "pkg:rpm/almalinux/libgomp@8.5.0-28.el8_10.alma.1#c61017c9a24eb6e1e1a3cdc9becd004a6419cbda3d54b4848b98f240a4829571"]}, {"ref": "pkg:rpm/almalinux/gsm@1.0.17-5.el8#576c6df5b8c2e212f6ae988c74da1d0f103c388063d37feb25f7392bddf3986f"}, {"ref": "pkg:rpm/almalinux/sox@14.4.2.0-29.el8#712c0d355206b77431db4488d00b0a2d10d3c4b5dfa6196e1637d6238d28af00"}, {"ref": "pkg:rpm/almalinux/libpng@1.6.34-9.el8_10#570812db8ef1fc54050fb57a74e7f468cba961a6a9ab4bcd175ead818e7c5bfa"}, {"ref": "pkg:rpm/almalinux/libgomp@8.5.0-28.el8_10.alma.1#c61017c9a24eb6e1e1a3cdc9becd004a6419cbda3d54b4848b98f240a4829571"}]}
@@ -0,0 +1 @@
1
+ cysox
Binary file
Binary file
Binary file
Binary file
Binary file