TimeFormatter
Defined in: packages/pleco-xa/src/scripts/xa-display.js:857
Time formatter for converting frame/sample indices to time strings
Extends
Section titled “Extends”AxisFormatter
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new TimeFormatter(
options?):TimeFormatter
Defined in: packages/pleco-xa/src/scripts/xa-display.js:865
Parameters
Section titled “Parameters”options?
Section titled “options?”Formatter options
hopLength
Section titled “hopLength”number = 512
Hop length in samples
number = 0
Lag parameter for time offset
number = 22050
Sample rate in Hz
string = 's'
Time unit: ‘s’, ‘ms’, ‘time’ (default: ‘s’)
Returns
Section titled “Returns”TimeFormatter
Overrides
Section titled “Overrides”AxisFormatter.constructor
Properties
Section titled “Properties”hopLength
Section titled “hopLength”hopLength:
number
Defined in: packages/pleco-xa/src/scripts/xa-display.js:869
lag:
number
Defined in: packages/pleco-xa/src/scripts/xa-display.js:867
sr:
number
Defined in: packages/pleco-xa/src/scripts/xa-display.js:868
unit:
string
Defined in: packages/pleco-xa/src/scripts/xa-display.js:870
Methods
Section titled “Methods”call()
Section titled “call()”call(
value):string
Defined in: packages/pleco-xa/src/scripts/xa-display.js:878
Format frame index to time string
Parameters
Section titled “Parameters”number
Frame index
Returns
Section titled “Returns”string
Formatted time (e.g., “1.23s”, “1234ms”)
Overrides
Section titled “Overrides”AxisFormatter.call
format()
Section titled “format()”format(
value,index):string
Defined in: packages/pleco-xa/src/scripts/xa-display.js:849
Make formatter callable (JavaScript equivalent of Python’s call)
Parameters
Section titled “Parameters”number
Tick value
number
Tick index
Returns
Section titled “Returns”string
Formatted label
Inherited from
Section titled “Inherited from”AxisFormatter.format