Skip to content

Commit

Permalink
Allow hooking into VBR calls
Browse files Browse the repository at this point in the history
I'm kinda shooting in the dark here, but I tried this on my local copy and it worked well. Please pull this if it seems correct.

Also added `self` call at the end since I needed to do that to expose Lame to other webworkers.
  • Loading branch information
akumpf committed Oct 4, 2013
1 parent ef697dc commit f7e40e6
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions post.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,21 @@ return {

set_bitrate: Module.cwrap('lame_set_brate', 'number', [ 'number', 'number' ]),
get_bitrate: Module.cwrap('lame_get_brate', 'number', [ 'number' ]),

set_VBR: Module.cwrap('lame_set_VBR', 'number', [ 'number', 'number' ]),
get_VBR: Module.cwrap('lame_get_VBR', 'number', [ 'number' ]),

set_VBR_q: Module.cwrap('lame_set_VBR_q', 'number', [ 'number', 'number' ]),
get_VBR_q: Module.cwrap('lame_get_VBR_q', 'number', [ 'number' ]),

set_VBR_mean_bitrate_kbps: Module.cwrap('lame_set_VBR_mean_bitrate_kbps', 'number', [ 'number', 'number' ]),
get_VBR_mean_bitrate_kbps: Module.cwrap('lame_get_VBR_mean_bitrate_kbps', 'number', [ 'number' ]),

set_VBR_min_bitrate_kbps: Module.cwrap('lame_set_VBR_min_bitrate_kbps', 'number', [ 'number', 'number' ]),
get_VBR_min_bitrate_kbps: Module.cwrap('lame_get_VBR_min_bitrate_kbps', 'number', [ 'number' ]),

set_VBR_max_bitrate_kbps: Module.cwrap('lame_set_VBR_max_bitrate_kbps', 'number', [ 'number', 'number' ]),
get_VBR_max_bitrate_kbps: Module.cwrap('lame_get_VBR_max_bitrate_kbps', 'number', [ 'number' ]),

encode_buffer_ieee_float: function(handle, channel_l, channel_r) {
var outbuf = _malloc(BUFSIZE);
Expand Down Expand Up @@ -65,3 +80,6 @@ return {

})();

self.Lame = Lame; // make Lame accessible to other webworker scripts.


0 comments on commit f7e40e6

Please sign in to comment.