Initial
This commit is contained in:
48
sample/SCRAPS.TXT
Normal file
48
sample/SCRAPS.TXT
Normal file
@@ -0,0 +1,48 @@
|
||||
for(DWORD index=0;index<numBytes;index++)*lpDstSample++=*lpSrcSample++;
|
||||
|
||||
|
||||
|
||||
class WaveForm;
|
||||
class FileIO;
|
||||
|
||||
FileIO &operator>>(FileIO &stream,WaveForm &waveForm);
|
||||
|
||||
|
||||
|
||||
//#ifndef _COMMON_FILEIO_HPP_
|
||||
//#include <common/fileio.hpp>
|
||||
//#endif
|
||||
|
||||
|
||||
|
||||
|
||||
/*
|
||||
bool WaveForm::save(String wavePathFileName,const PureSample &somePureSample,DWORD samplesPerSecond,DWORD avgBytesPerSecond)
|
||||
{
|
||||
DWORD waveFileLength((long)sizeof(mHeaderString)+(long)sizeof(mLengthData)+(long)sizeof(mSubHeaderString)+(long)sizeof(FormatChunk)+(long)sizeof(DataChunk)+(long)somePureSample.numSamples());
|
||||
|
||||
wavePathFileName.upper();
|
||||
if(!wavePathFileName.strstr(mExtensionString))wavePathFileName+=mExtensionString;
|
||||
MemFile waveFile(wavePathFileName,waveFileLength);
|
||||
mLengthData=somePureSample.numSamples()+sizeof(mSubHeaderString)+mFormatChunk.size()+mDataChunk.size();
|
||||
for(short chunkIndex=0;chunkIndex<mGenericChunks.size();chunkIndex++)mLengthData+=mGenericChunks[chunkIndex].chunkLength();
|
||||
if(!waveFile.write((char*)&mHeaderString,sizeof(mHeaderString)))return false;
|
||||
if(!waveFile.write((char*)&mLengthData,sizeof(mLengthData)))return false;
|
||||
if(!waveFile.write((char*)&mSubHeaderString,sizeof(mSubHeaderString)))return false;
|
||||
mFormatChunk.formatTag(FormatChunk::WaveFormatPCM);
|
||||
mFormatChunk.channels(FormatChunk::NumChannels);
|
||||
mFormatChunk.samplesPerSecond(samplesPerSecond);
|
||||
mFormatChunk.averageBytesPerSecond(avgBytesPerSecond);
|
||||
mFormatChunk.blockAlign(FormatChunk::BlockAlign);
|
||||
mFormatChunk.bitsPerSample(FormatChunk::BitsPerSample);
|
||||
if(!mFormatChunk.write(waveFile))return false;
|
||||
mDataChunk.length(somePureSample.numSamples());
|
||||
for(chunkIndex=0;chunkIndex<mGenericChunks.size();chunkIndex++)
|
||||
{
|
||||
if(!mGenericChunks[chunkIndex].write(waveFile))return false;
|
||||
}
|
||||
if(!mDataChunk.write(waveFile))return false;
|
||||
if(!somePureSample.write(waveFile))return false;
|
||||
return waveFile.flushBuffer();
|
||||
}
|
||||
*/
|
||||
Reference in New Issue
Block a user