Read-only archive of the All About Symbian forum (2001–2013) · About this archive

Unable to read a wav file

0 replies · 3,184 views · Started 23 June 2005

I am trying to dump a wav file which is already in a folder,I am just trying to read it and dump it another folder .I have used

TBuf8<40000> buf8;

// Create (replace) the direct file store
RFile f1;
RFs fsSession;
User::LeaveIfError(fsSession.Connect());
// User::LeaveIfError(fsSession.SetSessionPath(Kpath));
TInt i=0;
if( ( i=f1.Open(fsSession,KSoundSampleFile,EFileRead| EFileStreamText))==KErrNone )
{

// User::Leave(i);

}

while (buf8.Length()==0)
{

f1.Read(buf8);
{
// User::Leave(i);
}

CFileStore* iFilestore=CDirectFileStore::ReplaceL(fsSession,Kpath,EFileWrite|EFileShareAny);
f1.Open(fsSession,Kpath,EFileWrite|EFileShareAny);
f1.Write(buf8);
}

f1.Close();
fsSession.Close();

it is working but taking the size of TBuf as 40000 is not a good paractice of programming .So what I want is I should read a part of file and write it agin the next part and write it till the end of file come (we can call it as sreaming).

Which API should I follow for this or from where can I get the example for this?
plz reply