feedInt16FromStream method
Implementation
Future<int> feedInt16FromStream(List<Int16List> buffer) async {
await _waitOpen();
if (_isInited != Initialized.fullyInitialized) {
throw Exception('Player is not open');
}
if (isStopped) {
return 0;
}
_needSomeFoodCompleter =
Completer<int>();
try {
var ln = await (FlutterSoundPlayerPlatform.instance.feedInt16(
this,
data: buffer,
));
assert(ln >= 0);
if (ln != 0) {
_needSomeFoodCompleter = null;
return (ln);
} else {
}
} on Exception {
_needSomeFoodCompleter = null;
if (isStopped) {
return 0;
}
rethrow;
}
if (_needSomeFoodCompleter != null) {
return _needSomeFoodCompleter!.future;
}
return 0;
}