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

iOS : Audio play during capture not working or audio play after stop crash #34

Open
mickbad opened this issue Aug 22, 2024 · 0 comments

Comments

@mickbad
Copy link

mickbad commented Aug 22, 2024

Hello

Thanks for this plugin

I have an issue when I use ths package. On specific page, I record with stream records like this

    // flutter_sound sample
    final Soundpool poolAudio = Soundpool.fromOptions(options: const SoundpoolOptions(
      streamType: StreamType.notification,
    ));

    await audioRecorder.start(
      (obj) async {
        // Calling Audio Samples In
        var buffer = Float64List.fromList(obj.cast<double>());
        final List<double> audioSample = buffer.toList();

        // ..... work work

        // play sound (package flutter_sound for example) doesn't work, no sound ... for sample :)
        ByteData soundData = await rootBundle.load("assets/test.mp3");
        int soundId = await poolAudio.load(soundData);
        poolAudio.play(soundId, rate: 2.0);
      },

      (Object e) => debugPrint('Error: $e'), // Error will appear when audio sample cannot be obtained

      // options
      sampleRate: 44100,
      bufferSize: 3000,
    );

I have already a dispose() function like this

  @override
  void dispose() async{
    super.dispose();
    await audioRecorder.stop();
  }

Next I go to another page with playing sound (webradio or flutter_sound like package), and in IOS crash application with this

[aurioc]            AURemoteIO.cpp:1128  failed: -10851 (enable 2, outf< 2 ch,  44100 Hz, Float32, deinterleaved> inf< 2 ch,      0 Hz, Float32, deinterleaved>)
[avae]            AVAEInternal.h:109   [AVAudioEngineGraph.mm:1344:Initialize: (err = PerformCommand(*outputNode, kAUInitialize, NULL, 0)): error -10851
[avae]          AVAudioEngine.mm:167   Engine@0x281ca2d20: could not initialize, error = -10851
[aurioc]            AURemoteIO.cpp:1128  failed: -10851 (enable 2, outf< 2 ch,  44100 Hz, Float32, deinterleaved> inf< 2 ch,      0 Hz, Float32, deinterleaved>)
[avae]            AVAEInternal.h:109   [AVAudioEngineGraph.mm:1344:Initialize: (err = PerformCommand(*outputNode, kAUInitialize, NULL, 0)): error -10851
Error Domain=com.apple.coreaudio.avfaudio Code=-10851 "(null)" UserInfo={failed call=err = PerformCommand(*outputNode, kAUInitialize, NULL, 0)}
Error Domain=NSOSStatusErrorDomain Code=2003329396 "(null)"
[avae]            AVAEInternal.h:76    required condition is false: [AVAudioPlayerNode.mm:591:StartImpl: (_engine->IsRunning())]
*** Terminating app due to uncaught exception 'com.apple.coreaudio.avfaudio', reason: 'required condition is false: _engine->IsRunning()'
*** First throw call stack:
(0x180efbc60 0x19872bee4 0x180fc650c 0x1dd5a8e08 0x1dd6748b4 0x1dd671fd4 0x1029879d8 0x10298b168 0x10298bddc 0x105ec21e4 0x105931794 0x180bbb094 0x180bbc094 0x180b68d44 0x180b68994 0x180eb7014 0x180e744f8 0x180e87174 0x1a19c6988 0x183689a88 0x183422f78 0x1020c4b38 0x1022484d0)
libc++abi: terminating with uncaught exception of type NSException
* thread #1, queue = 'com.apple.main-thread', stop reason = signal SIGABRT
    frame #0: 0x00000001bb7dfbbc libsystem_kernel.dylib`__pthread_kill + 8
libsystem_kernel.dylib`:
->  0x1bb7dfbbc <+8>:  b.lo   0x1bb7dfbd8               ; <+36>
    0x1bb7dfbc0 <+12>: stp    x29, x30, [sp, #-0x10]!
    0x1bb7dfbc4 <+16>: mov    x29, sp
    0x1bb7dfbc8 <+20>: bl     0x1bb7db60c               ; cerror_nocancel
Target 0: (Runner) stopped.

I think I must destroy recorder but, sorry, I'm lost :)

Do you have a solution or is-it an issue ?

many thanks
Mick

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant