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

Chrome on Windows 10 vs Chrome on iOS #22

Open
jdmacmurtrie opened this issue Jul 10, 2020 · 2 comments
Open

Chrome on Windows 10 vs Chrome on iOS #22

jdmacmurtrie opened this issue Jul 10, 2020 · 2 comments
Labels

Comments

@jdmacmurtrie
Copy link

Hello!
Thank you for this package, I've found it extremely useful. I have a very specific question for you.

Have you ever experienced any difficulties in using the recorder in Chrome on a Windows 10 vs on a Mac (Catelina 10.15.5)?

I've implemented the recorder as instructed:

Mp3Recorder.stop()
    .getMp3()
    .then(([, blob]) => {
        const audioSrc = URL.createObjectURL(blob);

        this.setState(() => ({ audioSrc }));
    })

I then pass the audio to the HTML audio element:

<audio ref={audio => (this.audio = audio)} src={audioSrc} />

and get the metadata, specifically the duration, through an event listener:

this.audio.addEventListener('loadedmetadata', e => this.loadMetaData(e));

loadMetaData(e) {
  const { duration } = e
  ...
}

The issue is, when I record for one minute on a Mac, the duration ends up being 59.712 seconds, whereas when I record in chrome on a Windows, the duration is 56.189.

I can't figure out if this is a side effect of the audio element, or if it has something to do with the original audioSrc. Have you ever experienced anything like this?

@buzinas
Copy link
Contributor

buzinas commented Jul 16, 2020

Honestly I don't have a Windows machine, so I've never tested it there.

@alectrocute
Copy link

I've run into this bug; I've always thought maybe it's to do with a misconfiguration of sample rate and/or sample size. Still haven't pinned it down. Will update this comment if/when I find.

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

No branches or pull requests

3 participants