[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Libcdio-help] 44 bit difference
From: |
Cuke |
Subject: |
Re: [Libcdio-help] 44 bit difference |
Date: |
Sun, 19 Apr 2009 16:37:51 -0700 (PDT) |
yes, sorry! :)
Robert William Fuller wrote:
>
> So it was a 44 byte difference, not a "44 bit" difference. I might have
> guessed something like that if you had said "bytes" instead of "bits" in
> the subject. It helps to be very careful when you state a problem. I'm
> glad to hear you solved it :-)
>
> Cuke wrote:
>> Ok so with the help of rocky i found that my program i post you didn't
>> add
>> the wav header. So i just add this lines of code after the OUTFILE open:
>>
>> //Get the track size in bytes and conver
>> int bytes= ( i_last_lsn - i_first_lsn + 1 ) * CDIO_CD_FRAMESIZE_RAW;
>> cout << "Nr Bytes:" << bytes+44 << endl;
>>
>> //Open the output file
>> ofstream outfile ("temp.wav",ofstream::binary | ofstream::app |
>> ofstream::out);
>>
>> //Waw format header specification
>> int waweChunkLength=bytes+44-8;
>> int fmtChunkLength=16;
>> int compressionCode=1;
>> int numberOfChannels=2;
>> int sampleRate=44100;
>> int blockAlign=44100*2*2;
>> int significantBps=4;
>> int extraFormatBytes=16;
>>
>> outfile.write("RIFF",4);
>> outfile.write((char*)&waweChunkLength,4);
>> outfile.write("WAVEfmt ",8);
>> outfile.write((char*)&fmtChunkLength,4);
>> outfile.write((char*)&compressionCode,2);
>> outfile.write((char*)&numberOfChannels,2);
>> outfile.write((char*)&sampleRate,4);
>> outfile.write((char*)&blockAlign,4);
>> outfile.write((char*)&significantBps,2);
>> outfile.write((char*)&extraFormatBytes,2);
>> outfile.write("data",4);
>> outfile.write((char*)&bytes,4);
>>
>> //Track Rip
>> for ( i_cursor = i_first_lsn; i_cursor <= i_last_lsn; i_cursor
>> ++) {
>>
>> Bare in mind hwr that the (char *) conversion is platform dependent and
>> that
>> this changed doesn't deal with endianness.
>> http://www.nabble.com/file/p23128111/main.cpp main.cpp i included a
>> working
>> c++ source file.
>
>
>
> _______________________________________________
> Libcdio-help mailing list
> address@hidden
> http://lists.gnu.org/mailman/listinfo/libcdio-help
>
>
--
View this message in context:
http://www.nabble.com/44-bit-difference-tp23065170p23128550.html
Sent from the Gnu - Libcdio - Help mailing list archive at Nabble.com.