Utils
check_path(filepath)
Check provided path if something wrong raise error.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
filepath
|
str
|
path to check. |
required |
Source code in asrbench\utils.py
6 7 8 9 10 11 12 13 14 15 16 17 18 |
|
get_audio_duration(audio_path)
Get audio duration in seconds.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
audio_path
|
str
|
path to audio file. |
required |
Returns:
Type | Description |
---|---|
float
|
duration of audio file in seconds. |
Source code in asrbench\utils.py
62 63 64 65 66 67 68 69 70 71 72 73 |
|
get_filename(filepath_)
Get filename by path provided.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
filepath_
|
str
|
entire path to file. |
required |
Returns:
Type | Description |
---|---|
str
|
name of file. |
Source code in asrbench\utils.py
21 22 23 24 25 26 27 28 29 30 |
|
get_rtf(runtime, duration)
Calculate Real Time Factor [RTF] in seconds.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
runtime
|
float
|
time for execution in seconds. |
required |
duration
|
float
|
audio duration in seconds. |
required |
Returns:
Type | Description |
---|---|
float
|
real time factor for data provided. |
Source code in asrbench\utils.py
48 49 50 51 52 53 54 55 56 57 58 59 |
|
get_runtime(start)
Calculate runtime by start time provided.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
start
|
float
|
start time in ms. |
required |
Returns:
Type | Description |
---|---|
float
|
time since start in seconds. |
Source code in asrbench\utils.py
33 34 35 36 37 38 39 40 41 42 43 44 45 |
|