• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
How to correctly allocating CFStrings in an AudioFileRegionList?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

How to correctly allocating CFStrings in an AudioFileRegionList?


  • Subject: How to correctly allocating CFStrings in an AudioFileRegionList?
  • From: Charles Constant <email@hidden>
  • Date: Wed, 14 Sep 2016 20:53:31 -0700


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 CFStrings. 

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@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: How to correctly allocating CFStrings in an AudioFileRegionList?
      • From: Charles Constant <email@hidden>
  • Prev by Date: Re: Coreaudio-api Digest, Vol 13, Issue 121
  • Next by Date: AudioUnitRender() thread safe?
  • Previous by thread: Re: Coreaudio-api Digest, Vol 13, Issue 121
  • Next by thread: Re: How to correctly allocating CFStrings in an AudioFileRegionList?
  • Index(es):
    • Date
    • Thread