Click here to Skip to main content
15,894,646 members
Home / Discussions / C#
   

C#

 
AnswerRe: Will Using Console.Beep(); Too Much Damage Your Computer? Pin
Ashfield9-Jun-08 21:24
Ashfield9-Jun-08 21:24 
QuestionBind a Datatable With an Hyperlink Column To a GridView Pin
HatakeKaKaShi9-Jun-08 16:51
HatakeKaKaShi9-Jun-08 16:51 
QuestionBinary Reader Scanning for string Pin
Jammer9-Jun-08 15:12
Jammer9-Jun-08 15:12 
AnswerRe: Binary Reader Scanning for string Pin
Insincere Dave9-Jun-08 17:21
Insincere Dave9-Jun-08 17:21 
GeneralRe: Binary Reader Scanning for string Pin
Jammer10-Jun-08 3:22
Jammer10-Jun-08 3:22 
AnswerRe: Binary Reader Scanning for string Pin
Guffa10-Jun-08 12:02
Guffa10-Jun-08 12:02 
GeneralRe: Binary Reader Scanning for string Pin
Jammer10-Jun-08 12:17
Jammer10-Jun-08 12:17 
GeneralRe: Binary Reader Scanning for string Pin
Jammer10-Jun-08 13:36
Jammer10-Jun-08 13:36 
Hmm ... it doesn't appear to be as simple as you suggest.

I have pieced together some code that performs as you suggest and i'm testing it with some wav files I have here ... after the initial "RIFF" chunk and the "fmt " chunk I have a file here with a "fact" chunk

public class factChunk
{
    public string sChunkID;
    public uint dwChunkSize;
    public uint dwNumSamples;
}


this particular file reports its factChunk ChunkSize as 4 ...

Looking at this file in Riffpad the chunks are detailed as

RIFF = len 611548 offset=0
fmt = len 18 offset 20
fact = len 4 offset 46
smpl = len 54 offset 58
data = len 611348 offset 120
INFO = len 80 offset 611480
INAM = len 17 offset 611488
IPRD = len 15 offset 611514
ISFT = len 17 offset 611538

I don't see how to make these correlate to positions leading on from each other? Can anyone help?

I'm reading in the RIFF and fmt chunks as they are standard to all wav files, then i'm kicking off a method that attempts to find the other chunks, but its completely failing to do so based on the reported chunk sizes.

public void FindNextChunk(BinaryReader bReader, long offset)
{
    _startPos = bReader.BaseStream.Position;
    genchunk.ChunkID = new string(bReader.ReadChars(4));
    genchunk.ChunkSize = bReader.ReadUInt32();
    FindNextChunk(bReader, _startPos + (long)genchunk.ChunkSize);
}


Jammer

Going where everyone here has gone before! Smile | :)
My Blog

GeneralRe: Binary Reader Scanning for string Pin
Guffa10-Jun-08 20:32
Guffa10-Jun-08 20:32 
GeneralRe: Binary Reader Scanning for string Pin
Jammer11-Jun-08 9:21
Jammer11-Jun-08 9:21 
QuestionForm Inheritance Pin
Dirso9-Jun-08 13:31
Dirso9-Jun-08 13:31 
AnswerRe: Form Inheritance Pin
MarkB7779-Jun-08 13:48
MarkB7779-Jun-08 13:48 
GeneralRe: Form Inheritance Pin
Dirso9-Jun-08 14:32
Dirso9-Jun-08 14:32 
GeneralRe: Form Inheritance Pin
MarkB7779-Jun-08 16:16
MarkB7779-Jun-08 16:16 
GeneralRe: Form Inheritance Pin
Dirso10-Jun-08 2:05
Dirso10-Jun-08 2:05 
GeneralRe: Form Inheritance Pin
MarkB77710-Jun-08 2:28
MarkB77710-Jun-08 2:28 
GeneralRe: Form Inheritance Pin
Dirso10-Jun-08 2:47
Dirso10-Jun-08 2:47 
GeneralRe: Form Inheritance Pin
MarkB77710-Jun-08 2:59
MarkB77710-Jun-08 2:59 
GeneralRe: Form Inheritance Pin
Dirso10-Jun-08 10:30
Dirso10-Jun-08 10:30 
GeneralRe: Form Inheritance (still can't edit) Pin
Dirso10-Jun-08 12:20
Dirso10-Jun-08 12:20 
QuestionCalling an Extension method from another Extension method (C# 3.0) Pin
Rajesh Moriyani9-Jun-08 12:43
Rajesh Moriyani9-Jun-08 12:43 
AnswerRe: Calling an Extension method from another Extension method (C# 3.0) Pin
jamie5509-Jun-08 13:08
jamie5509-Jun-08 13:08 
AnswerRe: Calling an Extension method from another Extension method (C# 3.0) Pin
Tariq A Karim9-Jun-08 16:39
Tariq A Karim9-Jun-08 16:39 
Questionacessing an id from object sender Pin
brsecu9-Jun-08 10:55
brsecu9-Jun-08 10:55 
AnswerRe: acessing an id from object sender Pin
Edmundisme9-Jun-08 11:07
Edmundisme9-Jun-08 11:07 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.