ok, this is my first approach... might look a bit complicated when it comes to the encoding, but just using [NSString stringWithCString:[[fiHa readDataOfLength:30] bytes]] makes umlauts in my german mp3s unusable, this approach tweaks with the encoding a bit and actually works:
<BLOCKQUOTE><font size="1"face="Geneva, Verdana, Arial">code:</font><HR><pre><font size=1 face=courier>
#import <string.h>
...
- (void)getID3v1TagFromFileAtPath

NSString *)path
{
NSString *tag, *title, *artist, *album;
NSData *data;
NSFileHandle *fiHa = [NSFileHandle fileHandleForReadingAtPath

ath];
[fiHa seekToFileOffset

[[[[NSFileManager defaultManager] fileAttributesAtPath

ath traverseLink:NO] objectForKey:NSFileSize] intValue] - <font color = blue>128</font>)];
tag = [[[NSString alloc] initWithData:[fiHa readDataOfLength:<font color = blue>3</font>] encoding:NSASCIIStringEncoding] autorelease];
if ([[tag lowercaseString] isEqualToString:<font color = orange>@"tag"</font>])
{
data = [fiHa readDataOfLength:<font color = blue>30</font>];
title = [[[NSString alloc] initWithData:data encoding:NSASCIIStringEncoding] autorelease];
title = [title substringWithRange:NSMakeRange(<font color = blue>0</font>, strlen([data bytes]))];
data = [fiHa readDataOfLength:<font color = blue>30</font>];
artist = [[[NSString alloc] initWithData:data encoding:NSASCIIStringEncoding] autorelease];
artist = [artist substringWithRange:NSMakeRange(<font color = blue>0</font>, strlen([data bytes]))];
data = [fiHa readDataOfLength:<font color = blue>30</font>];
album = [[[NSString alloc] initWithData:data encoding:NSASCIIStringEncoding] autorelease];
album = [album substringWithRange:NSMakeRange(<font color = blue>0</font>, strlen([data bytes]))];
NSLog(<font color = orange>@"Title: \<font color = red>"</font>%@\"</font>", title);
NSLog(<font color = orange>@"Artist: \<font color = red>"</font>%@\"</font>", artist);
NSLog(<font color = orange>@"Album: \<font color = red>"</font>%@\"</font>", album);
} else {
NSLog(<font color = orange>@"No valid ID3v1 tag"</font>);
}
}
</font>[/code]
it doesn't check whether the path actually exists, it's assumed it does.
any useful info on id3v2?