diff options
author | David Barksdale <amatus@amatus.name> | 2013-09-30 21:33:49 -0500 |
---|---|---|
committer | David Barksdale <amatus@amatus.name> | 2013-09-30 21:33:49 -0500 |
commit | 692a845e55fc7c07ef3681525885a07a2c3fc749 (patch) | |
tree | abc39514efbcd636616c76fed15363ac67067f5c /mp3lame.rs | |
parent | 0e7aecc0fba231f4efc4f16e71f8d1b3952660ff (diff) |
Added output MP3 file writing.
Diffstat (limited to 'mp3lame.rs')
-rw-r--r-- | mp3lame.rs | 14 |
1 files changed, 14 insertions, 0 deletions
@@ -118,6 +118,20 @@ impl LameContext { mp3buf } } + #[fixed_stack_segment] + pub fn encode_flush_nogap(&self) -> ~[u8] { + unsafe { + let mut mp3buf: ~[u8] = vec::with_capacity(7200); + let length = lame_encode_flush_nogap(self.gfp, + vec::raw::to_mut_ptr(mp3buf) as *c_uchar, + 7200); + if length < 0 { + return ~[]; + } + vec::raw::set_len(&mut mp3buf, length as uint); + mp3buf + } + } } impl Drop for LameContext { |