Semantiva - Audio specialization
Overview
semantiva_audio is the audio specialization of the Semantiva framework. It offers tailored data types and operations for
audio operations. This module provides algorithms for processing single-channel and dual-channel audio data. It includes specialized algorithms for both types, as well as utilities for merging dual-channel audio into a single-channel format and expanding single-channel audio into dual-channel.
Installation
This module is available via Pypi:
pip install semantiva_audio
This command should install the package and all its dependencies, including Semantiva itself.
Getting Started: A Minimal Example
Below is a quick demonstration showing how to use the specialization. This assumes that the installation section was completed successfully. In this example, we will create a custom audio algorithm SingleChannelAudioMultiplyAlgorithm, which multiplies single-channel audio data by a given factor.
import numpy as np
from semantiva_audio.audio_data_types import SingleChannelAudioDataType
from semantiva_audio.audio_operations import SingleChannelAudioAlgorithm
class SingleChannelAudioMultiplyAlgorithm(SingleChannelAudioAlgorithm):
"""
A specialized algorithm to multiply single-channel audio data by a given factor.
"""
def _operation(self, data, factor):
self.logger.debug("Inside the SingleChannelAudioMultiplyAlgorithm")
multiplied_data = data.data * factor
return SingleChannelAudioDataType(multiplied_data)
# Example usage of SingleChannelAudioMultiplyAlgorithm
# Create an instance of the multiplication algorithm
multiply_algorithm = SingleChannelAudioMultiplyAlgorithm()
# Example input: Single-channel audio data
input_audio = SingleChannelAudioDataType(np.random.rand(1000))
# Define a multiplication factor
factor = 2.0
# Process the data using the algorithm
output_audio = multiply_algorithm(input_audio, factor)
Explanation:
-
Class Inheritance:
SingleChannelAudioMultiplyAlgorithmextendsSingleChannelAudioAlgorithm, which defines input/output data types.
-
Custom Operation:
- The
_operation(data, factor)method multiplies every element in the input audio data by a specified factor. - The method takes
SingleChannelAudioDataTypeas input and returns a new instance of the same type.
- The
-
Usage Example:
- We create a
SingleChannelAudioMultiplyAlgorithminstance. - Provide an example single-channel audio input with numerical values.
- Define a multiplication factor (
2.0in this case). - Call
_operation(input_audio, factor)to process the data. - The modified output is printed, showing the multiplied values.
- We create a
License
Semantiva is released under the MIT License, promoting collaborative development and broad adoption.
Acknowledgments
This framework draws inspiration from the rigorous demands of transparency and traceability in data-driven systems, particularly exemplified by the ALICE O2 project at CERN. The lessons learned from managing large-scale, high-throughput data in that environment—combined with the need for robust, domain-aligned workflows—shaped Semantiva’s emphasis on type-safe design, semantic clarity, and modular extensibility. By blending these concepts with principles of ontology-driven computing, Semantiva aims to deliver the same level of reliability and interpretability for any domain requiring advanced data processing and HPC integration.
Metadata
Release files for semantiva_audio 0.0.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| semantiva_audio-0.0.1.tar.gz | 7.6 kB | Without provenance | Details for semantiva_audio-0.0.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| semantiva_audio-0.0.1-py3-none-any.whl | Python 3 | none | any | Details for semantiva_audio-0.0.1-py3-none-any.whl |
Total release size: 13.8 kB
Release files / semantiva_audio-0.0.1.tar.gz
| Download URL | semantiva_audio-0.0.1.tar.gz |
|---|---|
| Size | 7.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
230b92ae4b8cb78099d7db736cba50e4fcd1f2dbf3db335c9564eef70ad29c85
|
|
BLAKE2b-256 checksum How to use checksums |
6eba2986e8fe3a7f63018a89e7ff61cad77e45aec83c1f067d47bc7c2867401e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
pdm/2.22.3 CPython/3.10.12 Linux/6.8.0-1020-azure
|
Release files / semantiva_audio-0.0.1-py3-none-any.whl
| Download URL | semantiva_audio-0.0.1-py3-none-any.whl |
|---|---|
| Size | 6.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
b6a687bc3d7f6b542f79bf2bb44221fc87027d0cf12c9f102183452d2b3a1f2a
|
|
BLAKE2b-256 checksum How to use checksums |
5c9954629b1f6876b45449f69fbd8c5870f6b7cb15d0350f932a388be8561e04
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
pdm/2.22.3 CPython/3.10.12 Linux/6.8.0-1020-azure
|
Security for semantiva_audio 0.0.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.