fm.liveswitch.SoundReframerContext Class Reference

A sound reframer context that can reframe sound chunks into consistent durations. More...

Public Member Functions

void addOnFrame (fm.liveswitch.IAction1< fm.liveswitch.AudioFrame > value)
 Adds a handler that is raised when a frame is ready. More...
 
fm.liveswitch.AudioConfig getConfig ()
 Gets the config. More...
 
boolean getDisableTimestampReset ()
 Gets whether timestamp resetting should be disabled entirely. More...
 
boolean getForceTimestampReset ()
 Gets whether to force a timestamp reset with the next raised frame. More...
 
int getFrameDuration ()
 Gets the frame duration. More...
 
int getTimestampResetInterval ()
 Gets the amount of time in milliseconds between audio frames that will trigger a wall-clock reset of the timestamp. More...
 
void processFrame (fm.liveswitch.AudioFrame frame, fm.liveswitch.AudioBuffer inputBuffer)
 Processes a frame. More...
 
void removeOnFrame (fm.liveswitch.IAction1< fm.liveswitch.AudioFrame > value)
 Removes a handler that is raised when a frame is ready. More...
 
void setDisableTimestampReset (boolean value)
 Sets whether timestamp resetting should be disabled entirely. More...
 
void setForceTimestampReset (boolean value)
 Sets whether to force a timestamp reset with the next raised frame. More...
 
void setTimestampResetInterval (int value)
 Sets the amount of time in milliseconds between audio frames that will trigger a wall-clock reset of the timestamp. More...
 
 SoundReframerContext (int frameDuration, fm.liveswitch.AudioConfig config)
 Initializes a new instance of the fm.liveswitch.SoundReframerContext class. More...
 

Protected Member Functions

long autoTimestamp (int timestampDelta)
 Gets the next timestamp. More...
 

Detailed Description

A sound reframer context that can reframe sound chunks into consistent durations.

Constructor & Destructor Documentation

◆ SoundReframerContext()

fm.liveswitch.SoundReframerContext.SoundReframerContext ( int  frameDuration,
fm.liveswitch.AudioConfig  config 
)

Initializes a new instance of the fm.liveswitch.SoundReframerContext class.

Parameters
frameDurationThe frame duration.
configThe configuration.

Member Function Documentation

◆ addOnFrame()

void fm.liveswitch.SoundReframerContext.addOnFrame ( fm.liveswitch.IAction1< fm.liveswitch.AudioFrame value)

Adds a handler that is raised when a frame is ready.

◆ autoTimestamp()

long fm.liveswitch.SoundReframerContext.autoTimestamp ( int  timestampDelta)
protected

Gets the next timestamp.

◆ getConfig()

fm.liveswitch.AudioConfig fm.liveswitch.SoundReframerContext.getConfig ( )

Gets the config.

◆ getDisableTimestampReset()

boolean fm.liveswitch.SoundReframerContext.getDisableTimestampReset ( )

Gets whether timestamp resetting should be disabled entirely.

Only applies if timestamps are auto-generated (i.e. not set on the frames).

◆ getForceTimestampReset()

boolean fm.liveswitch.SoundReframerContext.getForceTimestampReset ( )

Gets whether to force a timestamp reset with the next raised frame.

If set to

true

, this value will be reset to

false

after the wall-clock reset takes place. Only applies if timestamps are auto-generated (i.e. not set on the frames).

◆ getFrameDuration()

int fm.liveswitch.SoundReframerContext.getFrameDuration ( )

Gets the frame duration.

◆ getTimestampResetInterval()

int fm.liveswitch.SoundReframerContext.getTimestampResetInterval ( )

Gets the amount of time in milliseconds between audio frames that will trigger a wall-clock reset of the timestamp.

Only applies if timestamps are auto-generated (i.e. not set on the frames). Defaults to 1000.

◆ processFrame()

void fm.liveswitch.SoundReframerContext.processFrame ( fm.liveswitch.AudioFrame  frame,
fm.liveswitch.AudioBuffer  inputBuffer 
)

Processes a frame.

Parameters
frameThe frame.
inputBufferThe input buffer.

◆ removeOnFrame()

void fm.liveswitch.SoundReframerContext.removeOnFrame ( fm.liveswitch.IAction1< fm.liveswitch.AudioFrame value)

Removes a handler that is raised when a frame is ready.

◆ setDisableTimestampReset()

void fm.liveswitch.SoundReframerContext.setDisableTimestampReset ( boolean  value)

Sets whether timestamp resetting should be disabled entirely.

Only applies if timestamps are auto-generated (i.e. not set on the frames).

◆ setForceTimestampReset()

void fm.liveswitch.SoundReframerContext.setForceTimestampReset ( boolean  value)

Sets whether to force a timestamp reset with the next raised frame.

If set to

true

, this value will be reset to

false

after the wall-clock reset takes place. Only applies if timestamps are auto-generated (i.e. not set on the frames).

◆ setTimestampResetInterval()

void fm.liveswitch.SoundReframerContext.setTimestampResetInterval ( int  value)

Sets the amount of time in milliseconds between audio frames that will trigger a wall-clock reset of the timestamp.

Only applies if timestamps are auto-generated (i.e. not set on the frames). Defaults to 1000.