pcm/Volume: Open() returns output sample format
Prepare for a new mode which may convert to a different sample format when applying volume, to reduce dithering.
This commit is contained in:
+2
-2
@@ -96,7 +96,7 @@ pcm_volume_change_float(float *dest, const float *src, size_t n,
|
||||
dest[i] = src[i] * volume;
|
||||
}
|
||||
|
||||
void
|
||||
SampleFormat
|
||||
PcmVolume::Open(SampleFormat _format)
|
||||
{
|
||||
assert(format == SampleFormat::UNDEFINED);
|
||||
@@ -118,7 +118,7 @@ PcmVolume::Open(SampleFormat _format)
|
||||
break;
|
||||
}
|
||||
|
||||
format = _format;
|
||||
return format = _format;
|
||||
}
|
||||
|
||||
ConstBuffer<void>
|
||||
|
||||
+3
-2
@@ -94,9 +94,10 @@ public:
|
||||
*
|
||||
* Throws on error.
|
||||
*
|
||||
* @param format the sample format
|
||||
* @param format the input sample format
|
||||
* @return the output sample format
|
||||
*/
|
||||
void Open(SampleFormat format);
|
||||
SampleFormat Open(SampleFormat format);
|
||||
|
||||
/**
|
||||
* Closes the object. After that, you may call Open() again.
|
||||
|
||||
Reference in New Issue
Block a user