Data Processing
Data processing utilities for audio files.
This module provides functions to load and split audio files into segments.
Author: Esgr0bar
load_audio(file_path, sr=44100)
Load an audio file.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
file_path |
str
|
Path to the audio file. |
required |
sr |
int
|
Sample rate for loading audio. |
44100
|
Returns:
Name | Type | Description |
---|---|---|
tuple |
Tuple containing the audio time series (numpy.ndarray) and sample rate (int). |
Source code in src/data_processing.py
11 12 13 14 15 16 17 18 19 20 21 22 23 |
|
split_tracks(file_path, segment_length=5)
Split an audio track into smaller segments.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
file_path |
str
|
Path to the audio file. |
required |
segment_length |
int
|
Length of each segment in seconds. |
5
|
Returns:
Name | Type | Description |
---|---|---|
list |
A list of audio segments (numpy.ndarray). |
Source code in src/data_processing.py
25 26 27 28 29 30 31 32 33 34 35 36 37 38 |
|