I'm having a rather bad time getting *AudioFileSetProperty* to write an
*AudioFileRegionList* to a CAF file. I suspect the problem is the way that
I'm allocating *CFString*s.
Is this an appropriate way to allocate *CFStrings* when setting a
marker.mName or region.mName?
rgn->mName = CFStringCreateWithFormat( kCFAllocatorDefault, NULL, CFSTR(
"Region-%d"), r );
My problem is that if I try to create a List that contains more than one
Region, as soon as I call *AudioFileSetProperty*, I get "EXC_BAD_ACCESS."
This happens unless I use a very small quantity of regions and markers. The
debugger shows the exact place where AudioFileSetProperty falls over as
either "CFStringGetLength" or "CAFRegion_NtoB(CAFRegion*)".
If I create only a single Region, and then use afinfo to view my file, I
get this type of thing:
MacBook-Pro:~ username$ afinfo /Users/username/UnitTest_CAF_ANSI_C.caf
File: /Users/username/UnitTest_CAF_ANSI_C.caf
File type ID: caff
Num Tracks: 1
----
Data format: 1 ch, 44100 Hz, 'lpcm' (0x0000000E) 16-bit big-endian
signed integer
no channel layout.
estimated duration: 5.001315 sec
audio bytes: 441116
audio packets: 220558
bit rate: 705600 bits per second
packet size upper bound: 2
maximum packet size: 2
audio data file offset: 4096
optimized
audio 220558 valid frames + 0 priming + 0 remainder = 220558
source bit depth: I16
1 regions; SMPTE time type 0 (none)
region 1, "Region-0", flags 00000000
marker 990, "Marker-990": frame 100 SMPTE time 0:00:00:00/0 type
1935828327 ('sbeg') channel 0
marker 991, "<unnnamed>": frame 200 SMPTE time 0:00:00:00/0 type
1936027236 ('send') channel 0
marker 992, "<unnnamed>": frame 300 SMPTE time 0:00:00:00/0 type
1935828327 ('sbeg') channel 0
The names should be "Marker-990" "Marker-991" "Marker-992" and so on.
Anyone have any ideas? I'm stumped, and after three days working on this, I
can't find much outside information.
Thanks,
Charles
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Coreaudio-api mailing list ([email protected])
Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/coreaudio-api/archive%40mail-archive.com
This email sent to [email protected]