Hi, I have a big flac file, i can divide this flac file into chunks by visual basic code, i can add header to these chunks by copying first 1K to other chunks, but chunks can not play properly, i think i need to change filesize from file headers of these chunks, i can read samplerate and samples count from header, but i do not know how can i calculate file size without reading all file, what must i change from these chunks too? I want to play each chunks themself, I read http://flac.sourceforge.net/format.html but i can not understand how can i change header for each chunk Thanks Alper ASMA _________________________________________________________________ Add photos, news, and blogs about the World Cup to your Live.com homepage! http://www.live.com/getstarted -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.xiph.org/pipermail/flac-dev/attachments/20060626/2a43f3e0/attachment.html
--- Alper ASMA <alperasma@msn.com> wrote:> Hi, > > I have a big flac file, i can divide this flac file into chunks by > visual basic code, i can add header to these chunks by copying first > 1K to other chunks, but chunks can not play properly, i think i need > to change filesize from file headers of these chunks, i can read > samplerate and samples count from header, but i do not know how can i > calculate file size without reading all file, what must i change from > these chunks too? I want to play each chunks themself, > I read http://flac.sourceforge.net/format.html but i can not > understand how can i change header for each chunkto do this correctly you have to split at frame boundaries. you also have to copy the metadata section, which is not necessarily the first 1K. once that is correct you should be able to run a decoder to scan through the chunks and recalculate the sizes. native FLAC is not really suited for editing like this. if you are doing it a lot you should probably use ogg flac or matroska. Josh __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com
Hello, I'm not sure, but your description makes it seem like you're trying to write your own FLAC-parsing and FLAC-creation code based on the file format descriptions. Things would go a lot more easily for you if you simply used the Standard C or C++ libraries provided in the FLAC distribution. The file format is documented for completeness, to encourage widespread adoption of FLAC, it is not intended as the starting point for new code. That's what the FLAC libraries are intended for. You could use the FLAC library to open your big flac file, then write out several smaller FLAC files by breaking up the data. Using the FLAC library, you wouldn't have to worry because the files you create would always play properly. I realize that jumping from Visual Basic to Standard C or C++ might sound like a big leap, but you're already trying to do some very advanced things by pulling apart file formats and write new files based on a very complex format. It would be much simpler to learn C and use the FLAC library. ... unless someone else out there has put a Visual Basic front-end on the FLAC library! Brian Willoughby Sound Consulting Begin forwarded message: I have a big flac file, i can divide this flac file into chunks by visual basic code, i can add header to these chunks by copying first 1K to other chunks, but chunks can not play properly, i think i need to change filesize from file headers of these chunks, i can read samplerate and samples count from header, but i do not know how can i calculate file size without reading all file, what must i change from these chunks too? I want to play each chunks themself, I read http://flac.sourceforge.net/format.html but i can not understand how can i change header for each chunk Thanks Alper ASMA