Open agbossi opened 1 year ago
I realized I am not initializing the library. Also found a simpler class. What I'm trying to do is
import 'package:opus_dart/opus_dart.dart';
import 'package:opus_flutter/opus_flutter.dart' as opus_flutter;
var lib = await opus_flutter.load();
initOpus(lib);
_decoder = SimpleOpusDecoder(sampleRate: sampleRate, channels: 1);
static Future<Int16List> decodeOpus(input, int sampleRate) async {
Int16List output = _decoder.decode(input: input);
return output;
}
the decoder is called after initialization. Now the error is in runtime
OpusException -1: invalid argument
When the exception was thrown, this was the stack:
dart-sdk/lib/_internal/js_dev_runtime/private/ddc_runtime/errors.dart 266:49 throw_
packages/opus_dart/src/opus_dart_decoder.dart 73:9 new
Any idea what this error means?
I'm trying to decode opus audio data by trying to copy that part of the example in the documentation. However I can't even get it to compile. I'm assuming I'm doing something wrong, but since it's practically a simplified copy, don't know what.
the error is