Audio CD Subchannel Info
Audio CD Subchannel Info
- Subject: Audio CD Subchannel Info
- From: bryscomat <email@hidden>
- Date: Mon, 17 Aug 2009 11:47:57 -0500
Hey everyone, is there any way to tell if an audio track on a CD
contains CDG subchannel info? Currently, I am using a the following
code to read the subchannel info:
dk_cd_read_t cd_read;
unsigned char *buffer = (unsigned char*)malloc(capacity);
memset(&cd_read, 0, sizeof(cd_read));
cd_read.offset = offset;
cd_read.sectorArea = 0xf8 + kCDSectorAreaSubChannel;
cd_read.sectorType = kCDSectorTypeUnknown;
cd_read.buffer = buffer;
cd_read.bufferLength = capacity;
[self openDevice];
if ( ioctl(self.fileDescriptor, DKIOCCDREAD, &cd_read) == -1 )
{
NSLog(@"Failed to read subchannel");
NSLog(@"Error: %d",errno);
free( buffer );
[self closeDevice];
return NO;
}
[self closeDevice];
It works great. Now I am wanting to create a loop to read only 1024
sectors at a time so that the UI can update in response to the time
left. I don't want the loop to begin if there's no subchannel info as
the ioctl call will fail an arbitrary number of times. Also, I'd like
to test all the tracks on CD insertion to indicate if subchannel info
is available. Is there another way to do this?
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden