Kagami / vmsg

:musical_note: Library for creating voice messages
https://kagami.github.io/vmsg/
Creative Commons Zero v1.0 Universal
348 stars 58 forks source link

ios 11.3 beta , mobile safari - unplayable audio tag #3

Closed rowntreerob closed 6 years ago

rowntreerob commented 6 years ago

after record , after enter text , tap send button , go to new screen with music note ( tap to get player

tap music note and an audio player comes up with the / slash thru the play icon .. i guess this means that safari cant play the format associated with the audio tag.

probably gonna be the same on 11.2. n due to the wasm regression bug

im not set up real well for ios debug but will attach before /after shots from devtools showing that the problem appears to be that the audio blob was not created successfully ( probably zero length or with just the headers )

It looks like the standard issue on ios 11.2+ where wasm fails.

fwiw - your script.processor will probably implement the following:

      processor.onaudioprocess = function(event) {
        //encoder.encode(getBuffers(event));
        worker.postMessage({ command: 'record', buffers: getBuffers(event) });
      }; 

in other similar libs exhibiting the same bug, note that 'onaudioprocess()' never gets called or is called once and the error stops the recording glomming up the state of the buffers storing / handling the raw audio.

see 'test case' ... near the bottom of [this thread](https://github.com/kripken/emscripten/issues/6042 screenshot from 2018-03-05 10-45-24 screenshot from 2018-03-05 10-49-39

)

Kagami commented 6 years ago

Thanks for the report. Unfortunately I don't have iOS to reproduce that.

Can you download recorded file (click on the icon after "sending" the comment) and attach here?

rowntreerob commented 6 years ago

clik handler is broken/undefined so not able to dload the mp3... see the 2nd image attached to issue . that is what i get cliking on the icon

rowntreerob commented 6 years ago

earlier, i also tested this lib which may be similar to what you grabbed from svn for your project... not sure

anyway higuma's lib had same issue i think .

Kagami commented 6 years ago

I pushed a quick hack which uses wasm-polyfill on iOS instead. Please try now. (Make sure to refresh the cache.)

rowntreerob commented 6 years ago

nope ... cleared cache in safari and retried... same result

Kagami commented 6 years ago

It might be another bug. Probably mp3 is fine, iOS just can't download it. I pushed other way to save blob, please try now.

rowntreerob commented 6 years ago

now it works on ios 11.3 beta ..

i cleared cash and the broken triangle link is gone ... mp3 plays back ok on ios safari.

Kagami commented 6 years ago

So seems like everything is working now? Thank you for your help!

Gregoor commented 6 years ago

Hi @rowntreerob, do more than ~4 consecutive recordings within a session work for you on iOS? (you could quickly test that here https://v67oz43lm7.codesandbox.io/) That's roughly the point where it starts breaking for me. Had a similar problem when using a JS encoding library in a worker on iOS before (ty btw for the iOS 11.3 tip, was going a bit crazy testing it on iOS 11.2).

Kagami commented 6 years ago

What type of error do you get? Would you mind creating separate issue for that?

Gregoor commented 6 years ago

Unfortunately I'm having trouble setting up the debug bridge to iOS Safari, which is why atm I have no info on why it fails. I'll see if I find a way around it, and when I do I'll create a separate issue.