question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

recorder in the WEB does not work

See original GitHub issue

Audio 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:closed
  • Created 2 years ago
  • Reactions:2
  • Comments:7

github_iconTop GitHub Comments

2reactions
TonyTNguyencommented, Aug 1, 2021

@pavelprosto94 Also don’t forget to do a hard reload your web page after add those 4 lines

0reactions
Larpouxcommented, Aug 2, 2021

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found