add_table()¶
- audformat.testing.add_table(db, table_id, index_type, *, columns=None, num_files=5, num_segments_per_file=5, file_duration='5s', file_root='audio', p_none=None, split_id=None, media_id=None)[source]¶
Add a table with random values.
By default, adds one column for every scheme in the database. To create a specific set of columns use
columns. If amedia_idis passed, the file format will be determined from there. Otherwise, WAV is used.- Parameters
db (
Database) – a databasetable_id (
str) – ID of table that will be createdindex_type (
str) – the index type, seeaudformat.define.IndexTypefor available index typescolumns (
Union[str,Sequence[str],dict[str,str|tuple[Optional[str],Optional[str]]],None]) – a list of scheme_ids or a dictionary with column names as keys and tuples of(scheme_id, rater_id)as values.Nonevalues are allowednum_files (
int|Sequence[int]) – by default files are named'001','002', etc. up the number of files. For a different ordering a sequence of integers can be passednum_segments_per_file (
int) – number of segments per file (only applies to segmented table)file_root (
str) – file sub directory
- Return type
- Returns
table object