2 Replies Latest reply on Aug 18, 2017 5:11 AM by MariusAD

    Record audio while playing audio

    MariusAD Level 1

      I'm working on a Cordova app where the user can record his/her voice with background audio. This is working perfectly in Android, but in iOS it don't. I don't know if this has anything to do with resources or something.

      I've tried with HTMLAudioElement and cordova-plugin-nativeaudio, it plays the audio while I'm not recording. But as soon as I turn the recorder on, it won't play the audio.

      I'm using cordoba-plugin-media for recording.

      Here is an example:

      var audio = new Audio("audio/click.wav");  
      button
      .addEventListener("touchstart", function(){
        
      var record = new Media(src, onSuccess, onError);
         record
      .startRecord(); 
         audio
      .play();
      }, false);

      I know that playing audio with onclick don't work, so thats why I'm using touchstart