Comments (5)
Oh my gosh, compressionLevel
is ignored totally. I will check that and other parameters if they're ignored.
But the default compression level literally is not set never, and the default value is null
(that means it won't be set). I will investigate about the second.
from node-flac-bindings.
Using default values, the function FLAC__stream_encoder_set_compression_level
is called only two times:
- When the encoder is created (the value is 5)
- When the encoder is going to be destroyed (the value is again 5)
You can see the debug session I have just done:
(lldb) r
Process 4216 launched: '/usr/local/bin/node' (x86_64)
Process 4216 stopped
* thread #1, queue = 'com.apple.main-thread', stop reason = breakpoint 1.1
frame #0: 0x0000000103bc563c libFLAC.dylib`FLAC__stream_encoder_set_compression_level
libFLAC.dylib`FLAC__stream_encoder_set_compression_level:
-> 0x103bc563c <+0>: pushq %rbp
0x103bc563d <+1>: movq %rsp, %rbp
0x103bc5640 <+4>: pushq %r15
0x103bc5642 <+6>: pushq %r14
Target 0: (node) stopped.
(lldb) print $rsi
(unsigned long) $2 = 5
(lldb) up
frame #1: 0x0000000103bc2bb5 libFLAC.dylib`FLAC__stream_encoder_new + 141
libFLAC.dylib`FLAC__stream_encoder_new:
0x103bc2bb5 <+141>: movq 0x8(%r15), %rdx
0x103bc2bb9 <+145>: movl $0x0, 0x35c8(%rdx)
0x103bc2bc3 <+155>: movl $0x638, %eax ; imm = 0x638
0x103bc2bc8 <+160>: xorl %ecx, %ecx
(lldb) c
Process 4216 resuming
Process 4216 stopped
* thread #1, queue = 'com.apple.main-thread', stop reason = breakpoint 1.1
frame #0: 0x0000000103bc563c libFLAC.dylib`FLAC__stream_encoder_set_compression_level
libFLAC.dylib`FLAC__stream_encoder_set_compression_level:
-> 0x103bc563c <+0>: pushq %rbp
0x103bc563d <+1>: movq %rsp, %rbp
0x103bc5640 <+4>: pushq %r15
0x103bc5642 <+6>: pushq %r14
Target 0: (node) stopped.
(lldb) print $rsi
(unsigned long) $3 = 5
(lldb) up
frame #1: 0x0000000103bc37de libFLAC.dylib`FLAC__stream_encoder_finish + 2074
libFLAC.dylib`FLAC__stream_encoder_finish:
0x103bc37de <+2074>: testl %r14d, %r14d
0x103bc37e1 <+2077>: jne 0x103bc37ed ; <+2089>
0x103bc37e3 <+2079>: movq (%r12), %rax
0x103bc37e7 <+2083>: movl $0x1, (%rax)
(lldb) c
Process 4216 resuming
Process 4216 exited with status = 0 (0x00000000)
I will investigate further, but it's true that with default values, the compression level is lower than expected with a value of 5.
from node-flac-bindings.
After this 45 minutes, I made some tests and I wrote a demo program in C to compare the outputs when using the default value of compression and when using a custom one.
https://gist.github.com/melchor629/67be65e2f7c1f42deb9064bdc4805401
I think this problem is not about the bindings, probably is from the FLAC library itself. It seems that the compression level must be explicitly called, if not will use 0, instead of 5. But as a workaround, I will set as a default value 5 instead of null
to force the bindings to use 5 value always and, of course, making the output a bit more compressed.
I don't know why the C program has an output size higher than the bindings, the duration of both flacs are exactly the same 🤔
from node-flac-bindings.
OK great - will give it a try.
Can't help you with the file sizes - wierd.
Thanks again
from node-flac-bindings.
@dmooney65 The file sizes is only a weird thing to comment :)
Should work now with the workaround.
from node-flac-bindings.
Related Issues (20)
- Can't instantiate flac.FileDecoder HOT 9
- prebuild-install WARN install No prebuilt binaries found (target=12.18.0 runtime=node arch=x64 libc= platform=win32) HOT 8
- Any documentation on how to write metadata to a flac file? HOT 5
- FLAC StreamDecoder unable to decode file when FileDecoder does HOT 17
- "Encoder has not been initialized yet" Error raised while using StreamEncoder HOT 7
- Installation fails on Android HOT 4
- Crashes on node 14.x HOT 2
- how to create metadata HOT 4
- Illegal instruction (Core dumped) error on Synology DS718+ HOT 10
- Decoder initialization failed: Error_opening_file HOT 26
- When I packaged the Electron project, it didn't work HOT 8
- Windows build errors HOT 11
- A specific song cannot be converted on windows HOT 16
- upgrade to 3.0.0, ES module error HOT 15
- New release breaks my code HOT 8
- macbook pro m1, 13.2 (22D49) can't load libflac HOT 6
- Support for foreign metadata RIFF chunks HOT 3
- 24bit encoding HOT 7
- Miss check object on ptr HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from node-flac-bindings.