Ignore:
Timestamp:
Aug 28, 2011, 6:08:55 AM (12 years ago)
Author:
roman
Message:
 
Location:
trunk/Utilities/GeneratePcmWavFile
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Utilities/GeneratePcmWavFile/GeneratePcmWavFile.cpp

    r9 r10  
    236236                                        if(m_fSignalPeriod > 0)
    237237                                        {
    238                                                 for(SIZE_T nIndex = 0; nIndex < nDataSize; nIndex += pWaveFormatEx->nBlockAlign)
     238                                                SIZE_T nSampleIndex = 0;
     239                                                for(SIZE_T nIndex = 0; nIndex < nDataSize; nIndex += pWaveFormatEx->nBlockAlign, nSampleIndex++)
    239240                                                {
    240                                                         const SHORT nValue = (SHORT) (m_fSignalAmplitude * sin(2 * M_PI * (ThreadContext.m_nCurrentSampleIndex + nIndex) / m_fSignalPeriod));
     241                                                        const SHORT nValue = (SHORT) (m_fSignalAmplitude * sin(2 * M_PI * (ThreadContext.m_nCurrentSampleIndex + nSampleIndex) / m_fSignalPeriod));
    241242                                                        SHORT* pnSampleData = (SHORT*) (Properties.pbBuffer + nIndex);
    242243                                                        for(WORD nChannelIndex = 0; nChannelIndex < pWaveFormatEx->nChannels; nChannelIndex++)
Note: See TracChangeset for help on using the changeset viewer.