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

Merge opus files in js #29

Closed
diverted247 opened this issue Aug 18, 2015 · 6 comments
Closed

Merge opus files in js #29

diverted247 opened this issue Aug 18, 2015 · 6 comments

Comments

@diverted247
Copy link

Apologies in advance for posting this as an issue.

We are using Recorderjs to encode to opus and the library is working great. We have a need to merge opus encoded files(identically encoded) on server in nodejs like so: file1.ogg + file2.ogg + ... fileN.ogg = final.ogg

The work would be paid but I would prefer final work be open source and in your name.

email: ted@light.ly

Thanks,
Ted Patrick

@chris-rudmin
Copy link
Owner

Hi Ted,

Unfortunately for me, I don't think there is any work to do. :) Ogg files support chaining, so you can concatenate the files safely. If you experience playback issues, It might be required that you make sure the serial number for each stream is unique (currently from my encoder it is not)

@chris-rudmin
Copy link
Owner

Reading here, it is possible that some players don't support chained files. If this is the case and you have lots of server cpu cycles and memory, I would suggest you decode and re-encode the opus files to get one large file.

@diverted247
Copy link
Author

Chris, the decode and encode server side was the item I wanted to avoid if possible. Was hoping this was removing the OGG wrapper, taking OPUS samples, glueing them together, and appending new OGG data. Obviously that would be far faster and a straightforward task with node file streams. One reason we want to use OPUS is quality/compression ratio for spoken audio is so high. Again would be more than happy to fund this work open source if you were up to it. Thanks for the context and details.

@chris-rudmin
Copy link
Owner

@diverted247 Unfortunately you cannot glue the opus packets together as the decoder is stateful and depends on the output of the previous packets to decode properly. Concatenating the ogg files would be your best option. Let me know if that suits your purpose.

@chris-rudmin
Copy link
Owner

@diverted247 I've just made some tweaks to support chaining ogg files in v0.4.3

@diverted247
Copy link
Author

Thanks Chris.

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

2 participants