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

Wrong length error when recording audio #112

Closed
ccapndave opened this issue Mar 23, 2016 · 2 comments
Closed

Wrong length error when recording audio #112

ccapndave opened this issue Mar 23, 2016 · 2 comments

Comments

@ccapndave
Copy link
Contributor

I am trying to record audio with RecordRTC 5.3.0, but whenever I stop recording I get a 'Wrong length' error (same behaviour in Chrome and Firefox). This is the complete output:

adapter.js shimming chrome!
utils.js:29 chrome: {"audio":true}
RecordRTC.js:47 started recording audio stream.
RecordRTC.js:763 Using recorderType: StereoAudioRecorder
RecordRTC.js:1819 StereoAudioRecorder is set to record number of channels:  2
RecordRTC.js:2180 sample-rate 44100
RecordRTC.js:2181 buffer-size 4096
RecordRTC.js:83 Initialized recorderType: StereoAudioRecorder for output-type: audio
RecordRTC.js:96 Stopped recording audio stream.
_typed-buffer.js:159 Uncaught RangeError: Wrong length!validateArrayBufferArguments @ _typed-buffer.js:159ArrayBuffer @ _typed-buffer.js:249(anonymous function) @ RecordRTC.js:2076webWorker.onmessage @ RecordRTC.js:2011

Any advice would be greatly appreciated!

@ccapndave
Copy link
Contributor Author

I found that this was caused by some kind of conflict with https://www.npmjs.com/package/core-js - removing core-js from the project lets this work as normal.

@ccapndave
Copy link
Contributor Author

So, it seems that this is caused by a V8 bug/feature (https://bugs.chromium.org/p/v8/issues/detail?id=4552). The problem seems to be that StereoAudioRecorder is using a DataView as a parameter to ArrayBuffer. This does work in V8, but not in core-js (which follows the spec?), and the consensus seems to be that actually it shouldn't really work in V8. Instead the length of the buffer should be passed as a parameter to the constructor.

AndersDJohnson pushed a commit to AndersDJohnson/RecordRTC that referenced this issue Apr 8, 2019
AndersDJohnson pushed a commit to AndersDJohnson/RecordRTC that referenced this issue Apr 8, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant