flutter_sound: [BUG]:Record audio is not working in web.
Flutter Sound Version :
flutter_sound: ^8.1.9
Severity
- NoSuchMethodError: tried to call a non-function, such as null: ‘dart.global.newRecorderInstance’
Platforms you faced the error
- Flutter Web
Describe the bug
when I call openAudioSession then i get this error.
openAudioSession(
focus: AudioFocus.requestFocusAndDuckOthers,
category: SessionCategory.record,
)
To Reproduce Steps to reproduce the behavior:
StreamController<Food> recordingDataController = StreamController<Food>();
await recorder.openAudioSession(
focus: AudioFocus.requestFocusAndDuckOthers,
category: SessionCategory.record,
);
await recorder.startRecorder(
codec: Codec.pcm16,
numChannels: 1,
sampleRate: 48000,
toStream: recordingDataController.sink,
);
Logs!!!
FS:—> openAudioSession —> openAudioSession Resetting flutter_sound Recorder Plugin —> resetPlugin <— resetPlugin NoSuchMethodError: tried to call a non-function, such as null: ‘dart.global.newRecorderInstance’
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Comments: 38 (1 by maintainers)
Did you include the javascript files into your xxx.html file ?
Look to this or this
For those with error dart.global.newPlayerInstance or dart.global.newRecorderInstance is not a function, after you include 4 extra lines in header of index.html, you need to do a hard reload web page (Chrome: F12, right click on refresh button). That is what happened to me.
try :