void CAhx::Decode(CArcFile* pclArc, LPBYTE ahx_buf, DWORD ahx_buf_len) { // Convert AHX to WAV DWORD wav_buf_len = pclArc->ConvEndian(*(LPDWORD)&ahx_buf[12]) * 2; YCMemory<BYTE> wav_buf(wav_buf_len + 1152 * 16); // Advance //+ 1152 * 2); // margen = layer-2 frame size wav_buf_len = Decompress(&wav_buf[0], ahx_buf, ahx_buf_len); // Output CWav wav; wav.Init(pclArc, wav_buf_len, pclArc->ConvEndian(*(LPDWORD)&ahx_buf[8]), ahx_buf[7], 16); wav.Write(&wav_buf[0]); }
// Function to convert to WAV files bool CNavel::Decode(CArcFile* archive) { const SFileInfo* file_info = archive->GetOpenFileInfo(); if (file_info->format != _T("WPD")) return false; // Read WPD Format FormatWPD wpd; archive->Read(&wpd, sizeof(FormatWPD)); // Output CWav wav; wav.Init(archive, file_info->sizeOrg - 44, wpd.freq, wpd.channels, wpd.bits); wav.Write(); return true; }
// Function to convert to WAV files BOOL CNavel::Decode(CArcFile* pclArc) { SFileInfo* pInfFile = pclArc->GetOpenFileInfo(); if (pInfFile->format != _T("WPD")) return FALSE; // Read WPD Format FormatWPD fWPD; pclArc->Read(&fWPD, sizeof(FormatWPD)); // Output CWav wav; wav.Init(pclArc, pInfFile->sizeOrg - 44, fWPD.freq, fWPD.channels, fWPD.bits); wav.Write(); return TRUE; }
// Function to convert to WAV bool CTrH::Decode(CArcFile* archive) { const SFileInfo* file_info = archive->GetOpenFileInfo(); if (file_info->format != _T("PX") || memcmp(archive->GetHeader(), "fPX ", 4) != 0) return false; // Read px header PXHed header; archive->Read(&header, sizeof(PXHed)); // Output CWav wav; wav.Init(archive, file_info->sizeOrg - 44, header.freq, header.channels, header.bits); wav.Write(); return true; }
BOOL CKatakoi::DecodeWar(CArcFile* pclArc) { if (pclArc->GetArcExten() != _T(".war")) return FALSE; if (memcmp(pclArc->GetHed(), "war ", 4) != 0) return FALSE; SFileInfo* pstfiWork = pclArc->GetOpenFileInfo(); // Reading YCMemory<BYTE> clmbtSrc(pstfiWork->sizeCmp); pclArc->Read(&clmbtSrc[0], pstfiWork->sizeCmp); if (memcmp(&clmbtSrc[0], "OggS", 4) == 0) { // Ogg Vorbis COgg ogg; ogg.Decode(pclArc, &clmbtSrc[0]); } else { // WAV(Supposedly) DWORD dwDataSize = *(LPDWORD)&clmbtSrc[4]; DWORD dwFreq = *(LPDWORD)&clmbtSrc[12]; WORD wChannels = *(LPWORD)&clmbtSrc[10]; WORD wBits = *(LPWORD)&clmbtSrc[22]; CWav wav; wav.Init(pclArc, dwDataSize, dwFreq, wChannels, wBits); wav.Write(&clmbtSrc[24]); } return TRUE; }
bool CWav::InitDeepCopy( const CWav & roWav ) { if( &roWav == this ) return false; Init( roWav.GetSampleCount() ); m_uiType = roWav.m_uiType; m_uiPos = roWav.m_uiPos; m_bPlaying = roWav.m_bPlaying; m_dAmpL = roWav.m_dAmpL; m_dAmpR = roWav.m_dAmpR; *m_poData = *roWav.m_poData; // deep copy return true; }