Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.


#4 "Could not open file"-problem with 5-hour, 48KHz file

Matthias Hunstig


I have downloaded Wavsplit to split a wave file I have
created from a DVB-broadcast. It ist PCM, Stereo,
48KHz, 16bit and about 5 hours long, which makes it
about 3.5GB.
Wavesplit tells me "Could not open file." when I trie to
split it.


  • Logged In: YES

    Sent email to mhunstig to try and track down problem, with
    extra line to print out the error message. Probably an issue
    with large file support as 3.5G is more than 2**31 bytes

    ifd = open (ifile, O_RDONLY);
    if (ifd == -1) {
    fprintf (stderr, "Could not open file.\n");
    printf ("Error number was %d %s \n", errno,
    strerror(errno)); /* new line */
    return 1;

  • Logged In: YES

    Confirmed this is a large file problem. May (possibly?) be
    fixed on Gnu/LInux by putting -D_LARGEFILE64_SOURCE in
    CFLAGS in the Makefile, and opening the file using

    ifd = open (ifile, O_RDONLY | O_LARGEFILE);

    Awating confirmation if this fixes the problem

    • assigned_to: nobody --> apfitch
  • Logged In: YES

    It's not a bug, it's a feature :-)
    The wav format is limited in length to 2 Gb, as the length is
    stored in a 32 bit field.

    Hence the bug is closed.

    Possibly a version of wavsplit that ignores that field and has
    Large File support could be written.

    • status: open --> closed