mirror of
https://github.com/badaix/snapcast.git
synced 2025-05-22 21:46:15 +02:00
player, receiver
git-svn-id: svn://elaine/murooma/trunk@208 d8a302eb-03bc-478d-80e4-98257eca68ef
This commit is contained in:
parent
746933a96a
commit
10323c0485
12 changed files with 307 additions and 309 deletions
|
@ -5,13 +5,13 @@
|
|||
#include <iostream>
|
||||
|
||||
|
||||
SampleFormat::SampleFormat(const std::string& format) : rate(rate_), bits(bits_), channels(channels_), sampleSize(bytes_), frameSize(frameSize_)
|
||||
SampleFormat::SampleFormat(const std::string& format) //: rate(rate_), bits(bits_), channels(channels_), sampleSize(bytes_), frameSize(frameSize_)
|
||||
{
|
||||
setFormat(format);
|
||||
}
|
||||
|
||||
|
||||
SampleFormat::SampleFormat(uint16_t sampleRate, uint16_t bitsPerSample, uint16_t channelCount) : rate(rate_), bits(bits_), channels(channels_), sampleSize(bytes_), frameSize(frameSize_)
|
||||
SampleFormat::SampleFormat(uint16_t sampleRate, uint16_t bitsPerSample, uint16_t channelCount) //: rate(rate_), bits(bits_), channels(channels_), sampleSize(bytes_), frameSize(frameSize_)
|
||||
{
|
||||
setFormat(sampleRate, bitsPerSample, channelCount);
|
||||
}
|
||||
|
@ -31,13 +31,13 @@ void SampleFormat::setFormat(const std::string& format)
|
|||
|
||||
void SampleFormat::setFormat(uint16_t rate, uint16_t bits, uint16_t channels)
|
||||
{
|
||||
rate_ = rate;
|
||||
bits_ = bits;
|
||||
bytes_ = bits / 8;
|
||||
channels_ = channels;
|
||||
if (bits_ == 24)
|
||||
bytes_ = 4;
|
||||
frameSize_ = channels_*bytes_;
|
||||
this->rate = rate;
|
||||
this->bits = bits;
|
||||
this->channels = channels;
|
||||
sampleSize = bits / 8;
|
||||
if (bits == 24)
|
||||
sampleSize = 4;
|
||||
frameSize = channels*sampleSize;
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue