Skip to content

Commit

Permalink
Add: Audio duration is now returned by default for each item.
Browse files Browse the repository at this point in the history
  • Loading branch information
Labbeti committed Mar 21, 2024
1 parent 40f6318 commit 10367cb
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/aac_datasets/datasets/audiocaps.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ class AudioCapsItem(TypedDict):
index: int
subset: str
sr: int
duration: float
# AudioCaps-specific attributes
audiocaps_ids: List[int]
start_time: int
Expand Down
3 changes: 3 additions & 0 deletions src/aac_datasets/datasets/clotho.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ class ClothoItem(TypedDict):
index: int
subset: str
sr: NotRequired[int]
duration: NotRequired[float]
# Clotho-specific attributes
keywords: NotRequired[List[str]]
sound_id: NotRequired[str] # warning: some files contains "Not found"
Expand Down Expand Up @@ -185,6 +186,7 @@ def __init__(
removed_columns = (
"audio",
"sr",
"duration",
"fname",
"sound_id",
"keywords",
Expand All @@ -195,6 +197,7 @@ def __init__(
)
else:
removed_columns = ()

for name in removed_columns:
column_names.remove(name)

Expand Down
1 change: 1 addition & 0 deletions src/aac_datasets/datasets/macs.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ class MACSItem(TypedDict):
index: int
subset: str
sr: int
duration: float
# MACS-specific attributes
annotators_ids: List[str]
competences: List[float]
Expand Down
1 change: 1 addition & 0 deletions src/aac_datasets/datasets/wavcaps.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ class WavCapsItem(TypedDict):
index: int
subset: str
sr: int
duration: float
# WavCaps-specific attributes
author: Optional[str] # FSD and SB
description: Optional[str] # BBC, FSD and SB only
Expand Down

0 comments on commit 10367cb

Please sign in to comment.