예제 #1
0
파일: spc_supp.cpp 프로젝트: djdron/zxtune
 void ApplyParameters()
 {
   if (SoundParams.IsChanged())
   {
     Looped = SoundParams->Looped();
     const Time::Microseconds frameDuration = SoundParams->FrameDuration();
     SamplesPerFrame = static_cast<uint_t>(frameDuration.Get() * ::SNES_SPC::sample_rate / frameDuration.PER_SECOND);
     Resampler = Sound::CreateResampler(::SNES_SPC::sample_rate, SoundParams->SoundFreq(), Target);
   }
 }
예제 #2
0
 void SetFrameDuration(Time::Microseconds frameDuration)
 {
   const auto totalDuration = Time::Microseconds(Data->TotalSamples * frameDuration.PER_SECOND / Data->Frequency);
   Data->FramesCount = std::max<uint_t>(1, static_cast<uint_t>(totalDuration.Get() / frameDuration.Get()));
   Data->SamplesPerFrame = Data->TotalSamples / Data->FramesCount;
 }