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.

Audio record ios 11 no data

See original GitHub issue

Since iOS 11 and the support of getusermedia, I would like to use the record feature for safari on iPad but is not working at all.

I checked this issue (https://github.com/muaz-khan/RecordRTC/issues/275). I have adapted my code to use StereoAudioRecorder. I get no error in the console but just that I record nothing (the data is 44 Bytes and is just empty) despite it works on chrome (PC).

Here is my dumb test index. I try to record the voice of the user for 1 second and then I stop and get the data. To easily debug I push in the html the base64 and I have a quick audio html5 to be able to play the sound.

<!DOCTYPE html>
<html>
<head>
<script src="https://webrtcexperiment-webrtc.netdna-ssl.com/RecordRTC.js"></script>
<script src="https://cdn.webrtc-experiment.com/gumadapter.js"></script>
</head>

<body>
<audio id="toto" controls></audio>
<div id="result" style="max-width:500px;     word-wrap: break-word; "></div>

<script>

function successCallback(audioStream) {
    // RecordRTC usage goes here
	
	var recordRTC = RecordRTC(audioStream, {recorderType: StereoAudioRecorder});
	recordRTC.startRecording();
	
	setTimeout(
		function() {recordRTC.stopRecording(function(audioURL) {
			var recordedBlob = recordRTC.getBlob();
			recordRTC.getDataURL(function(dataURL) { 
			    var audio = document.querySelector('audio');
                audio.src = dataURL;
			    document.getElementById("result").innerHTML = dataURL;
			});
		});}, 1000);
}

function errorCallback(error) {
    // maybe another application is using the device
}

var mediaConstraints = { audio: true };

navigator.mediaDevices.getUserMedia(mediaConstraints).then(successCallback).catch(errorCallback);

</script>
</body>
</html>

Thanks for your help.

Issue Analytics

  • State:open
  • Created 6 years ago
  • Reactions:2
  • Comments:66

github_iconTop GitHub Comments

5reactions
kaliatechcommented, Apr 10, 2018

@danielstorey - Cloning the audiostream does seem to work as an alternative to calling getUserMedia again to get a new stream, and might be easier to use in some implementations. It doesn’t seem to work if the stream’s tracks are stopped though.

@DrLongGhost - ~I can not replicate your findings if the track is stopped and context closed. When track/context is closed after recording is complete, then switching apps seems to break things almost every time. If the track/context is left open, then switching apps tends to be okay.~ UPDATE: 20180410 - After removing dependencies to ensure everything is cleaned up when recording is finished, I can now replicate. I no longer have stability issues when switching apps or sleeping/locking, even if closing tracks.

I’m no longer user RecordRTC so won’t continue here, but in case it helps, I built a cleaner demo showing everything I’ve learned.

5reactions
larschristensencommented, Nov 8, 2017

@GersonRosales Example 3 indeed seems able to correctly start and stop multiple recordings on iOS11.1, so this approach looks promising. Thanks for pointing me in this direction, I’ll look more into it.

Read more comments on GitHub >

github_iconTop Results From Across the Web

iOS 11/12/13/14/15 Screen Recorder No Sound? Fix In 6 Ways!
Method 1. Turn on the Microphone Audio ... The microphone audio needs to be on so that iPhone screen recorder can capture voices...
Read more >
How to Fix iOS 12/11 Screen Recording Not Working/Saving
Part 1How to fix iOS 12/11 screen recording no sound on iPhone/iPad ; Settings > ; General > ; Reset > ; Reset...
Read more >
Easy Fix iPhone Screen Recording No Sound in iOS 15, 14 ...
Solution 1: Turn on your microphone audio ... iPhone screen recorder won't capture the audio of the video you are trying to record...
Read more >
Make a recording in Voice Memos on iPhone - Apple Support
Recordings using the built-in microphone are mono, but you can record stereo using an external stereo microphone that works with iPhone. Look for...
Read more >
[10 Tips] iOS 11 Screen Recording Not Working - FonePaw
Actually, it is very simple to fix this issue when you record iOS screen. Just reveal Control Centre and tap on Screen 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