mirror of
https://github.com/claunia/cuetools.net.git
synced 2025-12-16 18:14:25 +00:00
LossyWAV support
This commit is contained in:
@@ -322,6 +322,7 @@ namespace WavPackDotNet {
|
||||
|
||||
_compressionMode = 1;
|
||||
_extraMode = 0;
|
||||
_blockSize = 0;
|
||||
|
||||
_bitsPerSample = bitsPerSample;
|
||||
_channelCount = channelCount;
|
||||
@@ -385,6 +386,14 @@ namespace WavPackDotNet {
|
||||
}
|
||||
}
|
||||
|
||||
virtual property Int64 BlockSize
|
||||
{
|
||||
void set(Int64 value)
|
||||
{
|
||||
_blockSize = value;
|
||||
}
|
||||
}
|
||||
|
||||
virtual void Write(array<Int32, 2>^ sampleBuffer, UInt32 sampleCount)
|
||||
{
|
||||
if (!_initialized)
|
||||
@@ -467,7 +476,7 @@ namespace WavPackDotNet {
|
||||
WavpackContext *_wpc;
|
||||
Int32 _finalSampleCount, _samplesWritten;
|
||||
Int32 _bitsPerSample, _channelCount, _sampleRate, _blockAlign;
|
||||
Int32 _compressionMode, _extraMode;
|
||||
Int32 _compressionMode, _extraMode, _blockSize;
|
||||
NameValueCollection^ _tags;
|
||||
String^ _path;
|
||||
bool _md5Sum;
|
||||
@@ -500,6 +509,9 @@ namespace WavPackDotNet {
|
||||
_md5hasher = gcnew MD5CryptoServiceProvider ();
|
||||
config.flags |= CONFIG_MD5_CHECKSUM;
|
||||
}
|
||||
config.block_samples = (int)_blockSize;
|
||||
if (_blockSize > 0 && _blockSize < 2048)
|
||||
config.flags |= CONFIG_MERGE_BLOCKS;
|
||||
|
||||
if (!WavpackSetConfiguration(_wpc, &config, (_finalSampleCount == 0) ? -1 : _finalSampleCount)) {
|
||||
throw gcnew Exception("Invalid configuration setting.");
|
||||
|
||||
Reference in New Issue
Block a user