Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Recording on iOS simulator not working #280

Closed
codeswot opened this issue Mar 12, 2024 · 5 comments
Closed

Recording on iOS simulator not working #280

codeswot opened this issue Mar 12, 2024 · 5 comments
Labels
waiting-for-response Waiting for someone to respond.

Comments

@codeswot
Copy link

Describe the bug
Recording does not work on ios simulator, the recording starts but the waveform or sign of audio being picked up is not showing and when I stop the recording and inspect the file path I do see the recorded audio but always with 28 bytes and the file does not play.

To Reproduce
Steps to reproduce the behavior:

//1
  final RecorderController recorderController =
      RecorderController()
        ..androidEncoder = AndroidEncoder.aac
        ..androidOutputFormat = AndroidOutputFormat.mpeg4
        ..iosEncoder = IosEncoder.kAudioFormatMPEG4AAC;
//2
    await recorderController.record();
//3
    final path = await recorderController.stop();

NOTE: the path is to the apps document directory which I can navigate via my macbook
Expected behavior
I expect the audio to be recorded and saved to the path

Smartphone (please complete the following information):

  • Device: iPhone 15 Pro Max (Simulator)
  • OS: 17.2
  • Version [e.g. 22]
@ujas-m-simformsolutions
Copy link
Collaborator

@codeswot Can you please try on real device also check if you can record after providing path in record function.

@ujas-m-simformsolutions ujas-m-simformsolutions added the waiting-for-response Waiting for someone to respond. label Mar 14, 2024
@jt274
Copy link

jt274 commented Apr 19, 2024

I can confirm same issue on a real device, and when path is provided to the record function.
#288

@Ujas-Majithiya
Copy link
Collaborator

@codeswot The issue might have to be the extension you have set. Please make sure that the file extension you're using is supported by the encoder you're using and the underlying platform.

@sarintom
Copy link

I have exactly the same problem. This used to work just fine:

_recorderController = RecorderController()
      ..androidEncoder = AndroidEncoder.aac
      ..androidOutputFormat = AndroidOutputFormat.mpeg4
      ..iosEncoder = IosEncoder.kAudioFormatMPEG4AAC
      ..sampleRate = 44100;

And trying to record into

_recordFilePath = await getApplicationDocumentsDirectory().then((value) => '${value.path}/recording.m4a');
await _recorderController.record(path: _recordFilePath);

So the file extension shouldn't be the problem. Any advice?

@ujas-m-simformsolutions
Copy link
Collaborator

As mentioned this comment, issue might be in misconfiguration of encoder with file format. I'm going to close this issue for now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
waiting-for-response Waiting for someone to respond.
Projects
None yet
Development

No branches or pull requests

5 participants