Click here to Skip to main content
15,898,373 members
Home / Discussions / C#
   

C#

 
QuestionWill Using Console.Beep(); Too Much Damage Your Computer? Pin
qszwdxefc9-Jun-08 16:59
qszwdxefc9-Jun-08 16:59 
AnswerRe: Will Using Console.Beep(); Too Much Damage Your Computer? Pin
Christian Graus9-Jun-08 17:16
protectorChristian Graus9-Jun-08 17:16 
JokeRe: Will Using Console.Beep(); Too Much Damage Your Computer? Pin
PIEBALDconsult9-Jun-08 17:26
mvePIEBALDconsult9-Jun-08 17:26 
GeneralRe: Will Using Console.Beep(); Too Much Damage Your Computer? Pin
MarkB7779-Jun-08 17:49
MarkB7779-Jun-08 17:49 
AnswerRe: Will Using Console.Beep(); Too Much Damage Your Computer? Pin
Joe Woodbury9-Jun-08 19:30
professionalJoe Woodbury9-Jun-08 19:30 
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 
Hi All,

I've having some problems using a Binary Reader to find a chunk of format information in a WAV file. Basically everything is working fine with my reader using the standard data chunks, thje problem starts when I parse the file for the actual "data" chunk. The WAV standard is a pretty loose file format and allows for all manner of chunks inbetween the basic information and where the actual WAVE data begins. Each chunk has an ID which is either "RIFF", "fmt ", other random ones, then there is a "data" chunk located at a variable location. The code below is shocking, I know hence why i'm here, it works for some files but its also horribly inefficient and is in no way reliable. Can someone enlighten me as to a sure fire way of getting to this "data" chunk?

private void LocateDataChunk(BinaryReader bReader)
{
    int _pos = 0
    for (int i = _pos; i < (int)riffChunk.dwFileLength; i++)
    {
        bReader.BaseStream.Position = i;
        try
        {
            dataChunk.sChunkID = new string(bReader.ReadChars(4));
            if (dataChunk.sChunkID == "data")
            {
                dataChunk.dwChunkSize = bReader.ReadUInt32();
                return;
            }
        }
        catch (Exception ex)
        {
        }
    }
}


riffChunk.dwFileLength is the uint byte count of the file.

Any help on this would be great.

Jammer

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

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 
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 

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.