Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length



Pages: [1]
  Print  
Author Topic: modifying existing files  (Read 4067 times)
DOCTECH
Newbie
*
Posts: 22


View Profile
« on: April 23, 2007, 10:43:15 PM »

I'm trying to write.WAV files to an SD card.  WAV files need the length of file in the header, so i need to mofify the file after it is written.   I bought some uALFAT modules (a while ago) thinking they supported this.  But it looks like that was ALFAT in framed mode?Huh  From the manuals it looks like only the new uALFATxp will do that for me?
Logged
SupportAdmin
Administrator
Hero Member
*****
Posts: 5527



View Profile WWW
« Reply #1 on: April 24, 2007, 05:53:33 AM »

Yes you are right. Our newest FAT library (found in ALFATxp) supports modifying files
Logged
DOCTECH
Newbie
*
Posts: 22


View Profile
« Reply #2 on: April 24, 2007, 03:33:39 PM »

OK - sad because I already have the uALFAT SD modules and ALFATxp seems to be a sledgehammer for the peanut that is my project. uALFAT does everything I want (really well I might add) except changing those two bytes.  I also prefer the OEM board which I can't buy for ALFATxp yet.

No chance of bringing back the ALFAT command that allowed mods to the first 256 bytes of a file into uALFAT? 

thanks.

Logged
SupportAdmin
Administrator
Hero Member
*****
Posts: 5527



View Profile WWW
« Reply #3 on: April 24, 2007, 04:37:52 PM »

We will add this to our list but no guarantee on when it will be done. This can always change with 100x OEM boards order from you
Logged
DOCTECH
Newbie
*
Posts: 22


View Profile
« Reply #4 on: April 24, 2007, 06:29:44 PM »


100x order is a possibility - what does that change?
Logged
SupportAdmin
Administrator
Hero Member
*****
Posts: 5527



View Profile WWW
« Reply #5 on: April 24, 2007, 06:45:39 PM »

please contact us directly
http://www.ghielectronics.com/contact.php
Logged
etnainst
Newbie
*
Posts: 10


View Profile
« Reply #6 on: April 26, 2007, 08:25:47 AM »

Standard MIDI files also have a length field in their headers that needs
to be updated when the file is closed.  In addition, there are other
embedded fields within a MIDI file that have length values, and these
fields can exist at any random location within the MIDI file.

This applies to MIDI files on SD cards as well as to USB drives.

Larry Chace, Etna Instruments
Logged
etnainst
Newbie
*
Posts: 10


View Profile
« Reply #7 on: April 26, 2007, 08:42:23 AM »

I should have added a comment about updating embedded length fields.

If the file isn't too long, one "simple" solution is to write a temporary version
of the .WAV (or .MID) file, placing dummy bytes where the length field is
located.  Then, at close, copy the file, changing the dummy bytes to their
correct values, making the final .WAV file.

Since the uALFAT (and USBwiz) support multiple opened files, it is even
possible to generate a second temporary file that contains the correct
values for other embedded length files, should there be a need for that.
Then, at the end, the two temporary files can be merged into the final
result file.

The only real problem with this is the amount of time it takes to generate
the copy, if the .WAV (or .MID) file is long.  MIDI files of a megabyte or so
aren't rare (in my application area, at least), and I'm not comfortable with
a long processing time after the 'DONE" button is pressed.

Larry Chace, Etna Instruments
Logged
SupportAdmin
Administrator
Hero Member
*****
Posts: 5527



View Profile WWW
« Reply #8 on: April 26, 2007, 11:33:09 AM »

we will push this up on our priority list
Logged
DOCTECH
Newbie
*
Posts: 22


View Profile
« Reply #9 on: April 29, 2007, 12:58:13 AM »

I had thought of the multiple copy trick. but my application involves automatically recording sound events (ultrasound from bats suitably heterodyned) so I need to be ready to go again as soon as possible after finishing recording - in case another event occurs.

i could also just run a small application over the files on a PC to write the file length after recovering the card from the field - but it would be much more elegant to just have wave files.  If I could be reasonably sure that the modifying bytes option would turn up in a later version of uALFAT I might go wth developing it using that trick for now - and redo my firmware at a later date....
Logged
GHI_Support
Administrator
Hero Member
*****
Posts: 1297


View Profile
« Reply #10 on: July 19, 2007, 09:49:22 AM »

uALFAT3 firmware  is out and it allows file modification.
Logged
Pages: [1]
  Print  
 
Jump to: