Expected input to be one of these types: double, single Instead its type was audioDeviceReader.

24 views (last 30 days)
Isn't the default output of audiodevicereader is double?
The error message - >> livedetection_lstm
Entering into while loop.
Error using dsp.STFT/step (line 251)
Expected input to be one of these types:
double, single
Instead its type was audioDeviceReader.
Error in dsp.STFT/parenReference (line 343)
Y = step(obj,u);
Error in extractFeatures (line 25)
Xcomp = stf(audioIn);
Error in livedetection_lstm (line 20)
features = extractFeatures(audioIn,16e3);

Answers (1)

Srivardhan Gadila
Srivardhan Gadila on 15 Apr 2021
audioDeviceReader returns a System object, deviceReader, that reads audio samples using an audio input device in real time. You can refer to the docuementation of audioDeviceReader for more information.
However when you call deviceReader as follows: audioFromDevice = deviceReader() it returns one frame of audio samples, which is a matrix of of the following Data Types: single | double | int16 | int32 | uint8.

Categories

Find more on Audio I/O and Waveform Generation in Help Center and File Exchange

Products


Release

R2020a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!