Skip to main content

sbvoicedb: Saarbrueken Voice Database Reader module

PyPI PyPI - Status PyPI - Python Version GitHub

This Python module provides capability to download and organize Saarbrücker Stimmdatenbank (Saarbrücken Voice Database, https://stimmdb.coli.uni-saarland.de/) with SQLAlchemy (sqlalchemy.org).

Features

  • Auto-download the database file at https://stimmdb.coli.uni-saarland.de

  • Auto-download the associated datasets from Zonedo: https://zenodo.org/records/16874898

  • Supports incremental, on-demand download per-pathology

  • Stores database information as a local SQLite3 file

  • Database and datasets are accessed via SQLAlchemy ORM (Object Relational Mapper) classes for ease of use

  • Acoustic and EGG signals can be retrieved as NumPy arrays directly

  • Supports filters to specify study conditions on pathologies, speaker’s gender and age, recording types, etc.

  • Fixes known errors in the dataset (i.e., corrupted files and swapping of acoustic/EGG data)

Install

pip install sbvoicedb

If you prefer manually downloading the full dataset from Zonedo (data.zip, the full dataset, 17.9 GB) you may download the file first and unzip the content to a directory. Make sure that the zip file’s internal structure is preserved. If you’re placing your downloaded database in my_svd folder, its directory structure should appear like this:

.../my_svd/
└── data/
    ├── 1/
    │   ├── sentnces
    │   │   ├── 1-phrase.nsp
    │   │   └── 1-phrase-egg.egg
    │   └── vowels
    │       ├── 1-a_h.nsp
    │       ├── 1-a_h.nsp
    │       ⋮
    │       └── 1-u_n-egg.egg
    ├── 2/
    │   │   ├── 2-phrase.nsp
    │   │   └── 2-phrase-egg.egg
    │   └── vowels
    │       ├── 2-a_h.nsp
    │       ├── 2-a_h.nsp
    │       ⋮
    │       └── 2-u_n-egg.egg
    ⋮

The default my_svd location is OS dependent:

Windows

~\AppData\Local\sbvoicedb\sbvoicedb

Linux

~/.local/share/sbvoicedb

macOS

~/Library/Application Support/sbvoicedb

Tutorial/Examples

from sbvoicedb import SbVoiceDb

# to open the database in the default location
db = SbVoiceDb()

# OR to open the database at a specific data location
dbpath = '<path to the root directory of the extracted database>'
db = SbVoiceDb(dbpath)

This creates a new database instance. If dbpath does not contain the SQLite database file, sbvoice.db, it gets populated from the dataset’s summary CSV file.

If any portion of the dataset is already available in data subdirectory, it further populates the recordings table. These database population processes are visualized with progress bars in the console.

By default, no dataset will be downloaded at this point. You can check how much of the datasets are available by

print(f"{db.number_of_sessions_downloaded}/{db.number_of_all_sessions}")

The db.number_of_all_sessions property should always return 2043.

It is also possible to pre-download the waveform data file (data.zip, a 18-GB file) from Zenodo, and initialize the shared database by running

SbVoiceDb(data_zip_file='data.zip')

Your study may only use a subset of the database. In such case, you can set filters on each table when creating the database object. For example, the following creates a subset of the database which only consists of recordings of sustained /a/ or /i/ at normal pitch, uttered by women of age between 50 and 70 with normal voice or with a diagnosis of Laryngitis or Dysphonie:

from sbvoicedb import Pathology, Speaker, RecordingSession, Recording

db_laryngitis = SbVoiceDb(
    dbdir,
    pathology_filter=Pathology.name.in_(["Laryngitis", "Dysphonie"]),
    include_healthy=True,
    speaker_filter=Speaker.gender == "w",
    session_filter=RecordingSession.speaker_age.between(50, 70),
    recording_filter=Recording.utterance.in_(("a_n", "i_n")),
)

The overview of the database can be found in the three SQLite views: recording_session_summary, recording_summary, and pathology_summary. These summary tables can be queried (possibly with additional constraints) and could easily be turned into a Pandas’ DataFrame. To list the recording sessions, use SbVoiceDb.recording_session_summary():

import pandas as pd

print(pd.DataFrame(db_laryngitis.recording_session_summary()))

prints

    speaker_id gender  age  session_id type  nb_recordings
0          142      w   54         495    p             14
1          732      w   63        1057    p             14
2         1358      w   58         449    p             14
3         1360      w   56         451    p             14
4         1379      w   59         568    p             14
...        ...    ...  ...         ...  ...            ...
38        2539      w   68        2405    p             14
39        2582      w   58        2537    p             14
40        2650      w   54        2516    p             14
41        2678      w   50        2544    p             14
42        2728      w   60        2602    p             14
[43 rows x 7 columns]

To list the recordings, use SbVoiceDb.recording_summary():

print(pd.DataFrame(db_laryngitis.recording_summary()))

prints

       id  speaker_id gender  age  session_id type utterance  duration
0    2602         142      w   54         495    p       a_n   1.89166
1    2599         142      w   54         495    p       i_n   1.42548
2    7553         732      w   63        1057    p       a_n   0.75482
3    7552         732      w   63        1057    p       i_n   1.40040
4    2505        1358      w   58         449    p       a_n   1.46502
..    ...         ...    ...  ...         ...  ...       ...       ...
81  27241        2650      w   54        2516    p       i_n   1.49020
82  27629        2678      w   50        2544    p       a_n   0.59864
83  27630        2678      w   50        2544    p       i_n   0.65198
84  28383        2728      w   60        2602    p       a_n   1.06466
85  28382        2728      w   60        2602    p       i_n   1.42588

[86 rows x 8 columns]

Finally, to list pathologies, use SbVoiceDb.pathology_summary():

print(pd.DataFrame(db_laryngitis.pathology_summary()))

prints

   id        name  nb_speakers  nb_sessions
0  25   Dysphonie           99          101
1   5  Laryngitis          128          140

In the SQLite database, the actual tables holding data are: pathologies, speakers, recording_sessions, and recordings. The contents of these tables can be accessed by

db.get_pathology_count()
db.get_speaker_count()
db.get_session_count()
db.get_recording_count()

db.iter_pathologies()
db.iter_speakers()
db.iter_sessions()
db.iter_recordings()
print(f"number of pathologies found: {db_laryngitis.get_pathology_count()}")
print(f"number of recording sessions found: {db_laryngitis.get_session_count()}")
print(f"number of unique speakers: {db_laryngitis.get_speaker_count()}")
print(f"number of recordings: {db_laryngitis.get_recording_count()}")
number of pathologies found: 2
number of recording sessions found: 43
number of unique speakers: 42
number of recordings: 86

To navigate through the actual database, you can iterate over the rows of any of the tables:

# iterate over included pathologies
for patho in db_laryngitis.iter_pathologies():
  print(f'{patho.id)}: {patho.name} ({patho.downloaded})'

# iterate over included speakers
for speaker in db_laryngitis.iter_speakers():
  print(f'{speaker.id)}: {speaker.gender}'

# iterate over included recording sessions
for session in db_laryngitis.iter_sessions():
  print(f'{session.id)}: speaker_id={session.speaker_id}, speaker_age={session.speaker_age}, speaker_health={session.type}'

# iterate over included recordings
for rec in db_laryngitis.iter_recordings():
  print(f'{rec.id)}: session_id={rec.session_id}, utterance={rec.utterance}, nspfile={rec.nspfile}, eggfile={rec.eggfile}'

To retrieve the acoustic and egg data, use Recording.nspdata and Recording.eggdata:

from os import path
import numpy as np
from matplotlib import pyplot as plt

rec = next(db_laryngitis.iter_recordings())

t = np.arange(rec.length)/rec.rate

fig, axes = plt.subplots(2, 1, sharex=True)
axes[0].plot(t, rec.nspdata)
axes[0].set_ylabel("acoustic data")
axes[0].set_title(path.relpath(rec.nspfile, db_laryngitis.datadir))
axes[1].plot(t, rec.eggdata)
axes[1].set_ylabel("EGG data")
axes[1].set_title(path.relpath(rec.eggfile, db_laryngitis.datadir))
axes[1].set_xlabel("time (s)")
plt.tight_layout()
plt.show()
Plots of acoustic and audio data

Data Corrections

SVD Dataset has a several recordings that are incorrectly stored. sbvoicedb corrects the following data files during file retrieval. (Downloaded files are not renamed.)

  • 139-xxx, 141-xxx - acoustic & egg swapped

  • 713-i_n/713-iau - corrupted NSP/EGG files

  • 980-iau/980-iau-egg - acoustic and EGG waveforms were flipflopped at n = 583414

  • 980-phrase/980-phrase-egg - acoustic & Egg files were named backwards

  • 1697-iau/1697-iau-egg - acoustic & Egg files were named backwards

  • 1697-phrase/1697-phrase-egg - acoustic & Egg files were named backwards

Uncorrected entries

  • 1573-a_n, 1573-i_n, 1573-u_n not cut correctly. It is possible to obtain correct intervals from 1573-iau.

License

Metadata

Release files for sbvoicedb 0.7.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for sbvoicedb 0.7.0
File Size Uploaded Provenance
sbvoicedb-0.7.0.tar.gz 88.4 kB With provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for sbvoicedb 0.7.0
File Interpreter ABI Platform
sbvoicedb-0.7.0-py3-none-any.whl Python 3 none any Details

Total release size: 175.2 kB

Release files / sbvoicedb-0.7.0.tar.gz

Download URL sbvoicedb-0.7.0.tar.gz
Size 88.4 kB
Tags Source
SHA-256 checksum
How to use checksums
cd60e399cd57cd1649bd3e4cb575e6589015b8b62f2d055958c0fa7b9c2c3462
BLAKE2b-256 checksum
How to use checksums
46ce09a458d1e6f21d28de660659e12d2671715f252f6dbe1b2adf4301877534
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 13, 2026.

Transparency log

Release files / sbvoicedb-0.7.0-py3-none-any.whl

Download URL sbvoicedb-0.7.0-py3-none-any.whl
Size 86.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
526ab078e2c61390573e4f0a724a9834251a58037f07cec12e1560bd1973e1cc
BLAKE2b-256 checksum
How to use checksums
777cb3f6aac4186f2d0e980b0ff21a1fe3f60eea10d570d03d1a4967a63a4635
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 13, 2026.

Transparency log

Security for sbvoicedb 0.7.0

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.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for sbvoicedb-0.7.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 13, 2026.

Transparency log

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.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page