public int getOffsetByChunk( String chunkID, int startOffset, int endOffset ) {

        for (int i = startOffset; i < endOffset; i++) {
            try {
                wavFile.seek( i );
            } catch (IOException e) {
                Logger.writeInFile(e.toString());
            }

            char [ ] charBuff = new char [ chunkID.length() ];
            byte [] byteBuff = new byte[ chunkID.length() ];


            try {
                wavFile.readFully( byteBuff, 0, byteBuff.length );
            } catch (IOException e) {
                Logger.writeInFile(e.toString());
            }

            for ( int j = 0; j < chunkID.length(); j++ ){
                charBuff[ j ] = ( char ) byteBuff[ j ];
            }

            if ( chunkID.equals( new String( charBuff ) ) ) {
                return i + chunkID.length();
            }
        }
        return -1;
    }