watson-developer-cloud / node-red-node-watson

A collection of nodes for the IBM Watson services
Apache License 2.0
82 stars 86 forks source link

Not all audio formats are accepted #402

Closed seanmtracey closed 6 years ago

seanmtracey commented 6 years ago

Currently, the STT node accepts WAV, MP3, OGG, and FLAC, but the STT service now accepts more formats than this.

Are the formats hard coded into the Node? If so, could we pass up any input to the STT service and let it decide whether or not is valid, and then handle the response? This would save us having to update the STT node as the service adds/removes formats.

chughts commented 6 years ago

Although the service provides an API to retrieve all models that it supports, it doesn't; provide an API to retrieve all audio formats that it supports.

So IMHO the way to tackle this would be to allow a msg.audioformat override.

chughts commented 6 years ago

... but on second thoughts. The node performs a check on the extension from a fileType check. We could add in configuration option to disable the fileType check.

chughts commented 6 years ago

.. which would have to default to false. ie by default perform the fileType check.

seanmtracey commented 6 years ago

Doesn't the STT service return an error when an unexpected data format / malformed request is made?

Instead of checking ahead of time and trying to decide whether or not we should make the request, could we just return any error message the server gives us (which I hope would say something like 'invalid format') to the user?

This way, instead of there being two checks to decide whether or not the file is valid (that may not necessarily agree) there would be only one which would always be correct.

chughts commented 6 years ago

Good point, however, the nodes do get use on devices, and the extra validation we do before sending large amounts of invalid data over the network to the Watson gateway, may save frustration.

chughts commented 6 years ago

Option of switching off format pre-checks implemented in 0.6.11