Closed Ramtinmoradi closed 3 months ago
You should check the parameters that you specify in startRecorder. It could be many things. Perhaps you specified a bad file name. Note: you don’t have access to a file system on web.
can you give me an example to use on the web?? It was working until a while ago.
observing a similar problem on Flutter web:
┌───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
│ #0 packages/flutter_sound/public/flutter_sound_recorder.dart 376:5 openRecorder
├┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄
│ 🐛 FS:<--- openAudioSession
└───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
TypeError: dart.global.newRecorderInstance is not a function
packages/flutter_sound_web/flutter_sound_recorder_web.dart 171:18 openRecorder
dart-sdk/lib/_internal/js_dev_runtime/patch/async_patch.dart 84:54 runBody
dart-sdk/lib/_internal/js_dev_runtime/patch/async_patch.dart 127:5 _async
packages/flutter_sound_web/flutter_sound_recorder_web.dart 161:28 openRecorder
packages/flutter_sound/public/flutter_sound_recorder.dart 402:51 _openAudioSession
dart-sdk/lib/_internal/js_dev_runtime/patch/async_patch.dart 45:50 <fn>
dart-sdk/lib/async/zone.dart 1661:54 runUnary
dart-sdk/lib/async/future_impl.dart 163:18 handleValue
dart-sdk/lib/async/future_impl.dart 847:44 handleValueCallback
dart-sdk/lib/async/future_impl.dart 876:13 _propagateToListeners
dart-sdk/lib/async/future_impl.dart 652:5 [_completeWithValue]
dart-sdk/lib/async/future_impl.dart 722:7 callback
dart-sdk/lib/async/schedule_microtask.dart 40:11 _microtaskLoop
dart-sdk/lib/async/schedule_microtask.dart 49:5 _startMicrotaskLoop
dart-sdk/lib/_internal/js_dev_runtime/patch/async_patch.dart 181:7 <fn>
which points to these lines:
@override
Future<void> openRecorder(
FlutterSoundRecorderCallback callback, {
required Level logLevel,
}) async {
int slotno = findSession(callback);
if (slotno < _slots.length) {
assert(_slots[slotno] == null);
_slots[slotno] = newRecorderInstance(callback, callbackTable);
} else {
assert(slotno == _slots.length);
--> _slots.add(newRecorderInstance(callback, callbackTable));
}
getWebSession(callback)!.initializeFlautoRecorder();
}
this code using flutter_sound 9.7.2
class _AudioRecorderState extends State<AudioRecorder> {
FlutterSoundRecorder? _recorder;
bool _isRecording = false;
late StreamController<FoodData> _streamController;
@override
void initState() {
super.initState();
_streamController = StreamController<FoodData>();
asyncInit();
}
Future asyncInit() async {
print("Init flutter sound recorder");
_recorder = FlutterSoundRecorder();
await _recorder!.openRecorder();
print("Init flutter sound recorder done");
}
....
I will look to that later. This problem is probably because your html file doesn’t load correctly flutter sound. But I would like to terminate startRecorder to stream on web, before looking to your issue.
Hi @Terranic .
Can you tell me how do you build your Web app ?
Android Studio ? VScode ? flutter build web
? Other ?
Android Studio
It seems that you are not loading the js scripts :
and also :
do I have to modify the index.html to include the scripts?
In old versions of flutter sound we had to include those scripts. But not anymore if you use the standard index.html provided by flutter. If you use your own index.html you have still to do that.
Please reopen this issue if you have still problems.
My project work with this packages on mobile and web, the web application for record sound is not work and has this error:
Error dart-sdk/lib/_internal/js_dev_runtime/private/ddcruntime/errors.dart 296:3 throw packages/flutter_sound/public/flutter_sound_recorder.dart 675:7 _startRecorder dart-sdk/lib/_internal/js_dev_runtime/patch/async_patch.dart 45:50
dart-sdk/lib/async/zone.dart 1661:54 runUnary
dart-sdk/lib/async/future_impl.dart 163:18 handleValue
dart-sdk/lib/async/future_impl.dart 847:44 handleValueCallback
dart-sdk/lib/async/future_impl.dart 876:13 _propagateToListeners
dart-sdk/lib/async/future_impl.dart 652:5 [_completeWithValue]
dart-sdk/lib/async/future_impl.dart 722:7 callback
dart-sdk/lib/async/schedule_microtask.dart 40:11 _microtaskLoop
dart-sdk/lib/async/schedule_microtask.dart 49:5 _startMicrotaskLoop
dart-sdk/lib/_internal/js_dev_runtime/patch/async_patch.dart 181:7
package version is flutter_sound: ^9.7.2