Git Product home page Git Product logo

opusenc.js's People

Contributors

rillke avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

opusenc.js's Issues

malloc is undefined

I appear to receive this error when wasm is used (it doesn't happen when using asm):

TypeError: Module.asm._malloc is undefined OpusEncoder.js line 422 > eval:1:118376
    _malloc http://localhost:7711/worker/OpusEncoder.js line 422 > eval:1
    getBufferFor http://localhost:7711/worker/EmsArgs.js:74
    readBlobAsArrayBuffer http://localhost:7711/worker/EmsArgs.js:52

I noticed that if I remove your input disabled attribute in your example and run the encoder twice, the same thing occurs. Is this intentional?

Searching around, the only thing similar is this: emscripten-core/emscripten#6632 (comment)

So I might give that a try myself when I have time.

Troubeling file modification served to end users through gh-pages and CF

  • Original: 00 00 00 00 B7 1D C1 04 6E 3B 82 *09* D9 26 43 0D ....·.Á.n;‚.Ù&C.
  • Fraudulent copy: 00 00 00 00 B7 1D C1 04 6E 3B 82 *20* D9 26 43 0D ....·.Á.n;‚ Ù&C.

(This is the only modification.)

yielding in invalid encoded files
Diff 15: Delete 2 bytes at address 0x00009347 (first file)
Diff 16: Add 2 bytes at address 0x00009348 (second file) after address 0x0000934A (first file)

  • Valid:
...
67 67 53 00 00 80 A9 03 00 00 00 00 00 4D BE 7A  ggS..€©......M¾z
4B 06 00 00 00 64 F6 98 B8 39       FF 2E FF 04  K....dö˜¸9  ÿ.ÿ.
...
  • Invalid:
...
67 67 53 00 00 80 A9 03 00 00 00 00 00 D8 7C 81  ggS..€©......Ø| 
30 06 00 00 00 AE 22       39 A3 39 FF 2E FF 04  0....®"  9£9ÿ.ÿ.
...

filename instead of blob

please can we have a proper filename.ogg instead of blob url?

blob:https%3A//rawgit.com/24d7eeb2-014d-4ba0-a6e7-392037a3311f

streaming support

First off, really neat work here with this! 👍

I came here via your post on StackOverflow, and I wanted to ask your thoughts on what would be involved in converting this to something that could accept a stream from getUserMedia. You also pointed to kazuki/opus.js-sample, however that's throwing opus_encoder_create failed whenever I try to use it.

I ended up here after playing around with libmp3lame.js for a while, but running into some (potentially unresolvable?) issues around audible artefacts at various bitrates.

Anyway, I guess I was hoping for your thoughts on what would be involved in adding streaming support, and to inquire whether that was something you've taken a crack at. Hope that you don't mind me opening an issue for this.

Is how can change encoder params?

Hey

In c/c++ I can use code like below

opus_encoder_ctl(enc, OPUS_SET_PACKET_LOSS_PERC(packetLossPercent));
opus_encoder_ctl(enc, OPUS_SET_INBAND_FEC( percent > 0 ? 1 : 0 ));
opus_encoder_ctl(enc, OPUS_SET_DTX(enable ? 1 : 0));

Is it possible to do same things in js?

Thank you

Files produced by WASM-Build bigger than asm.js

WASM:

XXX@XXX:~/Downloads$ opusinfo encoded.opus
Processing file "encoded.opus"...

New logical stream (#1, serial: 633146a3): type opus
Encoded with libopus 1.2.1
User comments section follows...
	ENCODER=opus-tools/opusenc https://blog.rillke.com/opusenc.js/ from opus-tools 0.1.10-2-g6f67426
	title=Follow me up to Carlow
	artist=Christoph Nolte
	album=The Rocky Road
	date=2009
	genre=Folk
	publisher=Jamendo
	copyright=2009-10-26T12:17:51+01:00 Christoph Nolte. Licensed to the public under http://creativecommons.org/licenses/by-sa/2.0/de/ verify at http://www.jamendo.com/album/54242/
	encoded_by=Jamendo : http://www.jamendo.com | LAME
	TRACKNUMBER=05
	TDTG=2014-05-30T11:51:21
	encoder=Lavf56.15.102
	METADATA_BLOCK_PICTURE=3|image/jpeg||200x200x24|<5348 bytes of image data>
Opus stream 1:
	Pre-skip: 312
	Playback gain: 0 dB
	Channels: 2
	Original sample rate: 44100Hz
	Packet duration:   20.0ms (max),   20.0ms (avg),   20.0ms (min)
	Page duration:   1000.0ms (max),  999.1ms (avg),  840.0ms (min)
	Total data length: 2013265 bytes (overhead: 1.17%)
	Playback length: 2m:51.829s
	Average bitrate: 93.73 kb/s, w/o overhead: 92.64 kb/s
Logical stream 1 ended

ASM.JS

XXX@XXX:~/Downloads$ opusinfo "encoded(1).opus"
Processing file "encoded(1).opus"...

New logical stream (#1, serial: 7eba927d): type opus
Encoded with libopus 1.2.1
User comments section follows...
	ENCODER=opus-tools/opusenc https://blog.rillke.com/opusenc.js/ from opus-tools 0.1.10-2-g6f67426
	title=Follow me up to Carlow
	artist=Christoph Nolte
	album=The Rocky Road
	date=2009
	genre=Folk
	publisher=Jamendo
	copyright=2009-10-26T12:17:51+01:00 Christoph Nolte. Licensed to the public under http://creativecommons.org/licenses/by-sa/2.0/de/ verify at http://www.jamendo.com/album/54242/
	encoded_by=Jamendo : http://www.jamendo.com | LAME
	TRACKNUMBER=05
	TDTG=2014-05-30T11:51:21
	encoder=Lavf56.15.102
	METADATA_BLOCK_PICTURE=3|image/jpeg||200x200x24|<5348 bytes of image data>
Opus stream 1:
	Pre-skip: 312
	Playback gain: 0 dB
	Channels: 2
	Original sample rate: 44100Hz
	Packet duration:   20.0ms (max),   20.0ms (avg),   20.0ms (min)
	Page duration:   1000.0ms (max),  999.1ms (avg),  840.0ms (min)
	Total data length: 1693170 bytes (overhead: 1.34%)
	Playback length: 2m:51.829s
	Average bitrate: 78.83 kb/s, w/o overhead: 77.77 kb/s
Logical stream 1 ended

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.