<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xml:base="http://www.newlc.com" xmlns:dc="http://purl.org/dc/elements/1.1/">
<channel>
 <title>NewLC - reading file header into a descriptor - Comments</title>
 <link>http://www.newlc.com/topic-9600</link>
 <description>Comments for &quot;reading file header into a descriptor&quot;</description>
 <language>en</language>
<item>
 <title>Re: reading file header into a descriptor</title>
 <link>http://www.newlc.com/topic-9600#comment-23528</link>
 <description>&lt;div class=&quot;smf-content&quot;&gt;Ok, I&amp;#039;ve got it working with a .wav file like this:&lt;br /&gt;&lt;div class=&quot;codeheader&quot;&gt;Code:&lt;/div&gt;&lt;div class=&quot;code&quot;&gt;_LIT8(KRIFF, &amp;quot;RIFF&amp;quot;);&lt;br /&gt;&lt;br /&gt;TBuf8&amp;lt;4&amp;gt; header;&lt;br /&gt;fRead.ReadL(header);&lt;br /&gt;&lt;br /&gt;if(header.Compare(KRIFF) == 0) {&lt;br /&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;RDebug::Print(_L(&amp;quot;RIFF header&amp;quot;));&lt;br /&gt;} else {&lt;br /&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;RDebug::Print(_L(&amp;quot;not RIFF header&amp;quot;));&lt;br /&gt;}&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;and for an AMR file like this:&lt;br /&gt;&lt;div class=&quot;codeheader&quot;&gt;Code:&lt;/div&gt;&lt;div class=&quot;code&quot;&gt;_LIT8(KAMR, &amp;quot;#!AMR\n&amp;quot;);&lt;br /&gt;&lt;br /&gt;TBuf8&amp;lt;6&amp;gt; header;&lt;br /&gt;fRead.ReadL(header);&lt;br /&gt;&lt;br /&gt;if(header.Compare(KAMR) == 0) {&lt;br /&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;RDebug::Print(_L(&amp;quot;AMR header&amp;quot;));&lt;br /&gt;} else {&lt;br /&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;RDebug::Print(_L(&amp;quot;not AMR header&amp;quot;));&lt;br /&gt;}&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;Thanks for your help!&lt;/div&gt;</description>
 <pubDate>Fri, 05 Aug 2005 07:36:05 +0200</pubDate>
 <dc:creator>miranda2112</dc:creator>
 <guid isPermaLink="false">comment 23528 at http://www.newlc.com</guid>
</item>
<item>
 <title>Re: reading file header into a descriptor</title>
 <link>http://www.newlc.com/topic-9600#comment-23527</link>
 <description>&lt;div class=&quot;smf-content&quot;&gt;thanks for the response yucca!&lt;br /&gt;&lt;br /&gt;I have tried a number of different ways but they mainly look something liek this:&lt;br /&gt;&lt;div class=&quot;codeheader&quot;&gt;Code:&lt;/div&gt;&lt;div class=&quot;code&quot;&gt;_LIT(KAMR, &amp;quot;#!AMR\n&amp;quot;);&lt;br /&gt;&lt;br /&gt;RFileReadStream fRead;&lt;br /&gt;&lt;br /&gt;TInt err = fRead.Open(aFs, KFileName, EFileRead);&lt;br /&gt;if(err == KErrNone) {&lt;br /&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;RDebug::Print(_L(&amp;quot;!!! file open successful!&amp;quot;));&lt;br /&gt;}&lt;br /&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;&lt;br /&gt;CleanupClosePushL(fRead);&lt;br /&gt;&lt;br /&gt;HBufC* header = HBufC::NewL(fRead, 6);&lt;br /&gt;&lt;br /&gt;if(header-&amp;gt;Compare(KAMR) == 0) {&lt;br /&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;RDebug::Print(_L(&amp;quot;AMR header&amp;quot;));&lt;br /&gt;} else {&lt;br /&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;RDebug::Print(_L(&amp;quot;not AMR header&amp;quot;));&lt;br /&gt;}&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;I think the problem with this is the max length (6) in the NewL...&lt;br /&gt;&lt;br /&gt;How would I do it using TBuf8&amp;lt;6&amp;gt;?&lt;br /&gt;&lt;br /&gt;Thanks again,&lt;br /&gt;Miranda&lt;/div&gt;</description>
 <pubDate>Fri, 05 Aug 2005 05:57:28 +0200</pubDate>
 <dc:creator>miranda2112</dc:creator>
 <guid isPermaLink="false">comment 23527 at http://www.newlc.com</guid>
</item>
<item>
 <title>Re: reading file header into a descriptor</title>
 <link>http://www.newlc.com/topic-9600#comment-23526</link>
 <description>&lt;div class=&quot;smf-content&quot;&gt;you could just use TBuf8&amp;lt;6&amp;gt; as a buffer and use RFile to read the bytes into it. Which approach are you currently using, and what is the excat problem you are facing with it ?&lt;br /&gt;&lt;br /&gt;yucca&lt;/div&gt;</description>
 <pubDate>Fri, 05 Aug 2005 05:45:12 +0200</pubDate>
 <dc:creator>yucca</dc:creator>
 <guid isPermaLink="false">comment 23526 at http://www.newlc.com</guid>
</item>
<item>
 <title>reading file header into a descriptor</title>
 <link>http://www.newlc.com/topic-9600</link>
 <description>&lt;div class=&quot;smf-content&quot;&gt;&lt;/div&gt;&lt;p&gt;&lt;a href=&quot;http://www.newlc.com/topic-9600&quot;&gt;read more&lt;/a&gt;&lt;/p&gt;</description>
 <comments>http://www.newlc.com/topic-9600#comments</comments>
 <category domain="http://www.newlc.com/forums/audio">Audio</category>
 <pubDate>Fri, 05 Aug 2005 05:33:12 +0200</pubDate>
 <dc:creator>miranda2112</dc:creator>
 <guid isPermaLink="false">10072 at http://www.newlc.com</guid>
</item>
</channel>
</rss>
