recorder in the WEB does not work
See original GitHub issueAudio recording in the WEB does not work. When trying to start the compiler, an error occurred. The recorder cannot start and record sound. For some reason, the browser does not ask for permission to record audio.
import 'dart:async';
import 'package:flutter/material.dart';
import 'package:flutter_sound/flutter_sound.dart';
class MicInterface extends StatefulWidget {
@override
_MicInterfaceState createState() => _MicInterfaceState();
}
class _MicInterfaceState extends State<MicInterface> {
FlutterSoundRecorder _myRecorder = FlutterSoundRecorder();
StreamController<Food> recordingDataController = StreamController<Food>();
@override
void initState() {
super.initState();
_openRecorder();
}
Future<void> _openRecorder() async {
await _myRecorder.openAudioSession(
focus: AudioFocus.requestFocusAndDuckOthers,
category: SessionCategory.record,
);
}
@override
void dispose() {
// Be careful : you must `close` the audio session when you have finished with it.
_myRecorder.closeAudioSession();
_myRecorder = null;
super.dispose();
}
@override
Widget build(BuildContext context) {
return Row(mainAxisAlignment: MainAxisAlignment.center, children: [
FloatingActionButton(
child: Icon(Icons.mic),
onPressed: () async {
await _myRecorder.startRecorder(
toStream: recordingDataController.sink,
codec: Codec.pcm16,
numChannels: 1,
sampleRate: 48000,
);
}),
Container(width: 20),
FloatingActionButton(
child: Icon(Icons.stop),
onPressed: () async {
await _myRecorder.stopRecorder();
}),
]);
}
}
Issue Analytics
- State:
- Created 2 years ago
- Reactions:2
- Comments:7
Top Results From Across the Web
How to Fix Windows 10 Voice Recorder Not Working
This article talks about Voice recorder windows 10 not working issue in detail and how you can resolve it in many ways.
Read more >Recorder won't launch from my web browser, Help!
If you're having troubles launching the recorder from within your web browser then you should try downloading our stand-alone app install so you...
Read more >Record steps to reproduce a problem - Microsoft Support
To open Steps Recorder, select the Start button, and then select Windows Accessories > Steps Recorder (in Windows 10), or Accessories > Problem...
Read more >Audio/video recording issues - VoiceThread
Any microphone or camera should work in VoiceThread, but there are some things that might result in audio or video recording difficulties.
Read more >How to Fix It When Your Windows Voice Recorder Not Working?
1. Right-click on the volume icon at the right bottom corner of your Windows 10 desktop, in the popping up window, select “Recording...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@pavelprosto94 Also don’t forget to do a hard reload your web page after add those 4 lines
Please re-open this issue if you still have problem with Flutter Sound on Web.
The documentation is now a little bit better, and I tested that the new version 8.3.9 works fine Flutter Sound on web.