arun_sl
23-06-2005, 09:27 AM
Hello all,
I am presently working to play the Mp3 file in 6600.
I am using the libmad library and integrated the code onto AudioStream example in order to play the MP3 file. My idea in implementation is as follows:
(1) open MP3 file and decode using DecodeOneFrame() function given by Libmad library, storing the decoded output into an HBufC.
(2) converting 16 bit data to 8 bit using ConvertFromUnicodeToUtf8() function and storing the resulting data into another HBufC8.
(3) writing decoded output into a temporary file
(4) reading the temporary file into the buffer as per the following code:
RFile audiofile;
err = audiofile.Open(fs, _L("c:\\Stream.buf"), EFileRead|EFileStream);
if (err==KErrNone)
{
// file opened ok, proceed reading
TInt idx=0;
while (idx<iStreamBuffer.Count())
{
TInt fstatus=audiofile.Read(*iStreamBuffer[idx],
(iStreamBuffer[idx])->MaxSize());
if (fstatus!=KErrNone)
break;
idx++;
}
ShowMessageL(_L("Loading complete!"), true);
}
else
{
// failed to open file
ShowMessageL(_L("Error loading audio sample!"), true);
}
iStreamStart=0;
iStreamEnd=iStreamBuffer.Count()-1;
audiofile.Close();
Still the program is not giving a proper audio response.
Is there any gross mistakes on following this procedure. Please help me to solve this problem. Any specific information if needed, please do ask.
Thanking you all in anticipation,
Waiting for your help,
Yours truly,
Arun S L
I am presently working to play the Mp3 file in 6600.
I am using the libmad library and integrated the code onto AudioStream example in order to play the MP3 file. My idea in implementation is as follows:
(1) open MP3 file and decode using DecodeOneFrame() function given by Libmad library, storing the decoded output into an HBufC.
(2) converting 16 bit data to 8 bit using ConvertFromUnicodeToUtf8() function and storing the resulting data into another HBufC8.
(3) writing decoded output into a temporary file
(4) reading the temporary file into the buffer as per the following code:
RFile audiofile;
err = audiofile.Open(fs, _L("c:\\Stream.buf"), EFileRead|EFileStream);
if (err==KErrNone)
{
// file opened ok, proceed reading
TInt idx=0;
while (idx<iStreamBuffer.Count())
{
TInt fstatus=audiofile.Read(*iStreamBuffer[idx],
(iStreamBuffer[idx])->MaxSize());
if (fstatus!=KErrNone)
break;
idx++;
}
ShowMessageL(_L("Loading complete!"), true);
}
else
{
// failed to open file
ShowMessageL(_L("Error loading audio sample!"), true);
}
iStreamStart=0;
iStreamEnd=iStreamBuffer.Count()-1;
audiofile.Close();
Still the program is not giving a proper audio response.
Is there any gross mistakes on following this procedure. Please help me to solve this problem. Any specific information if needed, please do ask.
Thanking you all in anticipation,
Waiting for your help,
Yours truly,
Arun S L