Currently there is no way to start() hark monitoring. When the exposed function hark(stream, options) is triggered, it automatically starts the poll.
A better way would be to:
- support an api to start the poll:
hark.start()
- on
hark.stop(), clear the setTimeout, disconnect the analyser and free associated resources
- Also, a way to update the media stream at runtime:
hark.setStream() - this would first do hark.stop() to teardown the current existing pipeline, and then re-create it using the new stream.
Currently there is no way to start() hark monitoring. When the exposed function
hark(stream, options)is triggered, it automatically starts the poll.A better way would be to:
hark.start()hark.stop(), clear the setTimeout, disconnect the analyser and free associated resourceshark.setStream()- this would first dohark.stop()to teardown the current existing pipeline, and then re-create it using the new stream.