Please please please help i am new to symbian c++ programming
i am trying to create a function that can read a wave file to extract information from the header such as the samplerate, compession, blockalign etc.
i have managed to be able to get the positions of the format and data chunks of the file using a loop and comparing a lit string with a string read from the filebuffer(TBuf8) however i am seeking to the various positions where the data i want is and i can get it.
i want to get the samplerate and store it into and TInt so i do this
plus12 = Fmtpos +12;
wavefile.Seek(ESeekStart,plus12);//seek to samplerate position
wavefile.Read(filebuffer,4); //read 4 bytes into the file buffer
TLex8 LexS(filebuffer); // copy the buffer into Tlex
TUint SampRate =0; // int variable for samplerate
LexS.Val(SampRate,EHex); // convert the number string in tlex to int SampRate
only the samplerate is in hex format preceded with 0x so it wont put anything into my TUint and samplerate remains 0.
do i just need to remove the 0x? if yes how do i do that
or am i doing this wrong and is there another way to do this?
thanks in advance God bless