- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The following functionis to read data from a ".pcm" file into a buffer. It doesn't work, but for a .txt file it works normal.
Variable "cPCMData" in the function always keeps empty. What wrong with it. Wish someone help me solve it. Thanks!
void ReadAudioPcm(vm_char* strFilename, Ipp8u *cPCMData, Ipp32u fileSize)
{
UMC::Status status;
UMC::FileReader* pFileReader = new UMC::FileReader();
UMC::FileReaderParams FileParams;
FileParams.m_portion_size = 0;
vm_string_strcpy(FileParams.m_file_name, strFilename);
status = pFileReader->Init(&FileParams);
if (status != UMC::UMC_OK)
exit (-1); //init failed
status = pFileReader->MovePosition(0);
pFileReader->ReadData(cPCMData, &fileSize);
pFileReader->Close();
delete pFileReader;
}
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello,
I just wrote a quick test code bellow. It looked fine for the PCM.
Could you please check PCM file name: Is it a unicode or ascii file name? and did you use theunicode or ascii to compile the UMC sample ?
Thanks,
Chao
void ReadAudioPcm(vm_char* strFilename, Ipp8u *cPCMData, Ipp32u fileSize)
{
UMC::Status status;
UMC::FileReader* pFileReader = new UMC::FileReader();
UMC::FileReaderParams FileParams;
FileParams.m_portion_size = 0;
vm_string_strcpy(FileParams.m_file_name, strFilename);
status = pFileReader->Init(&FileParams);
if (status != UMC::UMC_OK)
exit (-1); //init failed
status = pFileReader->MovePosition(0);
pFileReader->ReadData(cPCMData, &fileSize);
pFileReader->Close();
delete pFileReader;
}
void main()
{
Ipp8u inut[1000000];
ReadAudioPcm("C:\\temp\\test.pcm", inut, 1000000);
}
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page