AudioVolumeConverter and AudioEchoConverter corrupt unsigned 8-bit PCM silence
Les mainteneurs répondent en général sous 2 jours
Personne n'a encore pris cette issue.
Évaluation
- Difficulté
- 3/5
- Temps estimé
- 1-2 jours
- Accessibilité débutants
- 76/100
- Type d'issue
- Bug
- Clarté
- Clairement spécifiée
- Activité
- Active
- Stack technique
- numpy, python
- Domaine
- audio-video-rtc
Piste de recherche
Start with the AudioVolumeConverter and AudioEchoConverter implementations and their public convert_async entry points. Reproduce the issue with the provided unsigned.wav setup, then compare the unsigned 8-bit handling with the existing signed PCM behavior. Done means both converters return eight uint8 silence samples with value 128 while preserving signed PCM behavior.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Description
Describe the bug
AudioVolumeConverter and AudioEchoConverter perform amplitude arithmetic directly on unsigned 8-bit PCM values. In this format silence is encoded as 128, not 0. Scaling or summing the uncentered values introduces a DC offset, and echo creates a discontinuity at the delay boundary even for a completely silent input.
Both converters accept the WAV and return successfully. This is distinct from the non-finite parameter validation fixes in #2613 and #2566: all parameters and input samples here are valid and finite.
Steps/Code to Reproduce
Run from an environment with PyRIT installed:
import asyncio
import tempfile
from pathlib import Path
import numpy as np
from scipy.io import wavfile
from pyrit.converter import AudioEchoConverter, AudioVolumeConverter
from pyrit.memory import CentralMemory, SQLiteMemory
async def main_async():
with tempfile.TemporaryDirectory() as directory:
memory = SQLiteMemory(db_path=':memory:')
memory.results_path = directory
CentralMemory.set_memory_instance(memory)
try:
source = Path(directory) / 'unsigned.wav'
samples = np.full(8, 128, dtype=np.uint8)
wavfile.write(source, 8000, samples)
for converter in (AudioVolumeConverter(volume_factor=0.5), AudioEchoConverter(delay=0.0005, decay=0.5)):
result = await converter.convert_async(prompt=str(source))
rate, output = wavfile.read(result.output_text)
print(type(converter).__name__ + ':', output.dtype, output.tolist())
finally:
memory.dispose_engine()
asyncio.run(main_async())
Expected Results
All eight output samples remain uint8 value 128 (silence), for both volume scaling and echo. Amplitude processing must center unsigned PCM around its midpoint before applying the effect, then restore the midpoint and clip to the original range.
Actual Results
AudioVolumeConverter: uint8 [64, 64, 64, 64, 64, 64, 64, 64]
AudioEchoConverter: uint8 [128, 128, 128, 128, 192, 192, 192, 192]
The input is eight uint8 samples all equal to 128. Volume factor is 0.5; echo delay is four samples and decay is 0.5. Signed PCM should retain its existing behavior.
Versions
Linux, Python 3.12.3, PyRIT 1.2.0.dev0 at 8934a3c4, NumPy 2.5.3, SciPy 1.18.1. Reproduced locally through the public convert_async methods with real WAV files; no model or external service is used.
- Langage dominant
- Python
- Étoiles
- 4.6k
- Forks
- 944
- Merge moyen
- 2 j 18 h
- PR mergées (30 j)
- 369
Préparer son environnement
Lance le conteneur de développement du projet dans votre navigateur, avec votre propre compte GitHub.
- Aucun Dockerfile ni fichier Docker Compose
- Propose un modèle de pull request
- Aucun guide de contribution
Par où commencer
- Lisez l'issue en entier, puis le guide de contribution du projet.
- Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
- Forkez le dépôt et travaillez sur une branche.
- Ouvrez une pull request qui référence le numéro de l'issue.
Autres issues de microsoft/PyRIT
-
BUG: label queries only return the final conversation of an attackPeut-être pris @u7k4rs6 l’a pris il y a 3 jours. Ouverte
Difficulté 2/5 1-3 heures Accessibilité débutants 85/100
microsoft/PyRIT#3095 · 4 commentaires · 1 personne assignée ·
Les mainteneurs répondent en général sous 2 jours
-
BUG Configuration keeps runtime-status errors after polling recoversPeut-être à nouveau libre @joeyvictorino l’a pris il y a 7 jours, et aucune pull request n’est ouverte. OuverteBug: triage GUI help wanted
Difficulté 2/5 1-3 heures Accessibilité débutants 86/100
microsoft/PyRIT#2868 · 6 commentaires ·
Les mainteneurs répondent en général sous 2 jours
-
FEAT: Support PDF and file inputs via `binary_path` in OpenAI chat and response targetsPeut-être pris @PranavD2905 l’a pris aujourd’hui. Ouvertefeature-request help wanted
Difficulté 4/5 3-5 jours Accessibilité débutants 35/100
microsoft/PyRIT#3274 · 1 commentaire ·
Les mainteneurs répondent en général sous 2 jours
-
feature-request
Difficulté 5/5 Plus d'une semaine Accessibilité débutants 18/100
Les mainteneurs répondent en général sous 2 jours
-
FEAT: Add supports_prefill capability and PrefillAttack strategyPeut-être pris Une pull request liée à cette issue est ouverte ou déjà fusionnée. Ouverte
Difficulté 3/5 1-2 jours Accessibilité débutants 35/100
Les mainteneurs répondent en général sous 2 jours
Toutes les issues de microsoft/PyRIT
Issues similaires
-
Difficulté 2/5 1-3 heures Accessibilité débutants 64/100
aws-samples/sample-per-model-bedrock#295 ·
Les mainteneurs répondent en général sous 1 jour
-
Difficulté 1/5 Moins d'une heure Accessibilité débutants 76/100
pyrevitlabs/pyRevit#3792 ·
Les mainteneurs répondent en général sous 1 jour
-
Difficulté 2/5 1-3 heures Accessibilité débutants 69/100
zephyrproject-rtos/reqmgmt#177 ·
-
Difficulté 2/5 1-3 heures Accessibilité débutants 78/100
polarsource/polar#15580 ·
Les mainteneurs répondent en général sous 1 jour
-
[开源推荐] Windows 系统维护工具箱,支持后台任务队列Ouverte
Difficulté 1/5 Moins d'une heure Accessibilité débutants 85/100
521xueweihan/HelloGitHub#4011 ·