ManagerAudio

Table of Contents

Methods

playMp3(sampleId, sampleopt, callbackopt)

Play MP3 audio sample

Parameters:
Name Type Attributes Description
sampleId string

unique id which can be used to play sounds that have been played before

sample Buffer | string <optional>

Buffer containing a WAV audio sample or path to file containing MP3 audio sample data. Sample is cached in Homey and can be played again by calling this function with the same sampleId without the sample argument which will result in the the sample loading faster.

callback genericCallbackFunction <optional>
Returns:

Promise

playWav(sampleId, sampleopt, callbackopt)

Play WAV audio sample

Parameters:
Name Type Attributes Description
sampleId string

unique id which can be used to play sounds that have been played before

sample Buffer | string <optional>

Buffer containing a WAV audio sample or path to file containing WAV audio sample data. Sample is cached in Homey and can be played again by calling this function with the same sampleId without the sample argument which will result in the the sample loading faster.

callback genericCallbackFunction <optional>
Returns:

Promise

removeMp3(sampleId, callbackopt)

Remove MP3 sample from cache

Parameters:
Name Type Attributes Description
sampleId string

The id of the MP3 that is cached

callback genericCallbackFunction <optional>

removeWav(sampleId, callbackopt)

Remove WAV sample from cache

Parameters:
Name Type Attributes Description
sampleId string

The id of the WAV that is cached

callback genericCallbackFunction <optional>