-
-
Notifications
You must be signed in to change notification settings - Fork 79
onaudioprocess is not being fired in ios safari. #4
Comments
Can you show a code example? |
I noticed it in the demo (https://ai.github.io/audio-recorder-polyfill/). I attached a error event listener to the player to see whats up and I got a MediaError object with error code 3 when trying to play the recording in ios safari 11. MDN on error code 3 in the MediaError object:
The blob size is always 44 B when recording in ios safari, so I dont know if its a encoding problem or a stream problem. I've tested it on a iphone 6 and two iphone 7, and the same error occurs for all devices. Unfortunately encoding is not my field of expertise, but I can help you test it in ios. |
It seems like |
The main problem is that not all Safari has this problem :(. BrowserStack and many my friends reported that everything is OK. In other had one my friend and you have the same problem with 44 B. So it is environment problem. Another thing — 44 B is a WAV file header. So Web Worked didn’t receive data from a microphone. Can you show your screenshot? How many seconds did you wait before pressing Record and Stop buttons? |
For what it's worth, I believe the issue here is discussed in this comment. Basically, creating a Since creating a new I created a hack that worked for my recent needs by creating the |
@alecglassford Wow! Thanks for this great review. I will think on next week how to implement this hack in the best way. |
* Related to issue ai#4
* Related to issue ai#4
Confirming @alecglassford 's comment. I've devised a different hack that requires passing in the audio context and script processor to the start method. Works, but still a hack and requires user of MediaRecorder to do work specific to ios/safari. |
@kaliatech does 0.1.2 at least partially fix the problem? Now the context is created only once and then reused. |
Can confirm that the PR posted by @kaliatech unfortunately does not work on iOS Safari still (on 11.2) |
@ai - I am not in a position to easily test latest version of this library, but just glancing over the commits, I believe the newer approach would work well as long as the context was created within a user event handler, per alecglasssford's earlier comment. I like the idea of using a mediarecorder polyfill as you've done here and think it's likely the cleanest option for most, but I had to test a number of other things so went with a more code heavy approach. (web-audio-recording-tests) @nkov - The PR I submitted did work on iOS, and current versions of this library do work on iOS even without that PR. You can verify by viewing the demo URL on the homepage of this repository. If still not working for you, then the most common reason is that the setup must be done within a user event handler. i.e. Button click event handler. See code example on the home page of this repository. If still having problems, then there are few more caveats that I wrote about in the notes here: https://kaliatech.github.io/web-audio-recording-tests/dist/#/test1 |
@kaliatech this link https://kaliatech.github.io/web-audio-recording-tests/dist/#/test1 still doesn't work on Safari web browser 12.x. The audio player just says " Error " and displays size: 44B, type: audio/wav |
@arj-ary Your comment here is in the wrong repository. If you want to discuss "web-audio-recording-tests", consider posting in that repository so as not to confuse things with the excellent work being done in this repository (audio-recorder-polyfill). In answer to your comment though, web-audio-recording-tests previously worked with Safari 12.x, and I just tested with iOS/Safari-12.4 and Mac/Safari-12.1.1. Both worked fine. Getting a 44B empty file was a common error when I was developing early versions, but I don't remember what usually led to it. Suggest restarting your device/machine and trying again. |
I'm looking forward for this polyfill :)
In the current version I have a problem with the playback of the blob in ios safari 11 (problem is also in the demo). Making the blob into url using createObjectURL() and attach it to a player don't work in ios safari 11.
The text was updated successfully, but these errors were encountered: