A library for async/sync playback audio.
Project description
seaplayer-audio
Description
The SeaPlayer library for async/sync playback audio.
The module is still under DEVELOPMENT, so I do not recommend using it in your projects.
Supported formats
- ✅ - fully supported
- ❌ - not supported
- 🌗 - partial support (supported, but with nuances)
It is based on the sounddevice and soundfile module.
soundfile, in turn, is a wrapper of the C/C++ library libsndfile, which has limitations in file reading formats. More info...
| Formats | Support |
|---|---|
| Microsoft WAV | ✅ |
| SGI / Apple AIFF / AIFC | ✅ |
| Sun / DEC / NeXT AU / SND | ✅ |
| Headerless RAW | ✅ |
| Paris Audio File (PAF) | 🌗 |
| Commodore Amiga IFF / SVX | 🌗 |
| Sphere Nist WAV | 🌗 |
| IRCAM SF | 🌗 |
| Creative VOC | 🌗 |
| Sound forge (W64) | ✅ |
| GNU Octave 2.0 (MAT4) | ✅ |
| GNU Octave 2.1 (MAT5) | ✅ |
| Portable Voice Format (PVF) | 🌗 |
| Fasttracker 2 XI | ❌ |
| Apple CAF | ✅ |
| Sound Designer II (SD2) | 🌗 |
| Free Lossless Audio Codec FLAC | 🌗 |
Usage
Through context manager
import time
from seaplayer_audio import CallbackSoundDeviceStreamer, FileAudioSource
def main():
with FileAudioSource('example.mp3') as source:
with CallbackSoundDeviceStreamer() as streamer:
while len(data := source.readline(1)) > 0:
streamer.send( data )
time.sleep(0.01)
if __name__ == '__main__':
main()
Through cycle
import time
from seaplayer_audio import CallbackSoundDeviceStreamer, FileAudioSource
def main():
file = FileAudioSource('example.mp3')
streamer = CallbackSoundDeviceStreamer()
streamer.start()
while len(data := source.readline(1)) > 0:
streamer.send( data )
time.sleep(0.01)
streamer.stop()
file.close()
if __name__ == '__main__':
main()
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file seaplayer_audio-0.1.21.tar.gz.
File metadata
- Download URL: seaplayer_audio-0.1.21.tar.gz
- Upload date:
- Size: 10.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.4 CPython/3.12.7 Windows/10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3d5c63a1992e2118fd06e1c7a9a8a1e70457f04e722493179e854be1d59b5d11
|
|
| MD5 |
0734c5e826ee3eb61385526011c11f1a
|
|
| BLAKE2b-256 |
6ff806658a99bbfc9dd58cc6279435c01d97eeb6d68e21755c06acd40dabc00e
|
File details
Details for the file seaplayer_audio-0.1.21-py3-none-any.whl.
File metadata
- Download URL: seaplayer_audio-0.1.21-py3-none-any.whl
- Upload date:
- Size: 13.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.4 CPython/3.12.7 Windows/10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d4e062066568bf23e6a9400e9f584eb4a20fe3c3943409c60d00c3f1c229de11
|
|
| MD5 |
77df8541e3f2361fb28ec8912b583391
|
|
| BLAKE2b-256 |
a5f7b920e48dbd8dee7348487923cf60b83c9913114e12d53c659d40db0a90c4
|