• 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
Re: set kAudioFilePropertyAlbumArtwork: fail
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: set kAudioFilePropertyAlbumArtwork: fail


  • Subject: Re: set kAudioFilePropertyAlbumArtwork: fail
  • From: Kyle Sluder <email@hidden>
  • Date: Mon, 05 Aug 2013 10:30:56 -0700

On Mon, Aug 5, 2013, at 01:37 AM, Alex _ wrote:
> Unfortunately, as soon as I try to set the artwork, the
> AudioFileSetProperty doesn't fail, but AudioFileClose does.
> Specifically I get: +[NSConcreteData bytes]: unrecognized selector sent
> to class
>
>         ...
>         NSData *image = [NSData dataWithContentsOfFile:@"/tmp/test.jpg"];
>         if (image != NULL)
>         {
>             checkError("AudioFileSetProperty",
>                        AudioFileSetProperty(audioID,
>                                             kAudioFilePropertyAlbumArtwork,
>                                             (UInt32)[image length],
>                                             CFBridgingRetain(image)));

You're assigning a pointer to the NSData object as a property value, but
telling AudioFileSetData that you're actually assigning a value of the
size of the bytes held by that NSData. At some point this corrupts your
heap, and -data (an instance method) winds up getting sent to
NSConcreteData (the class).

You want to do:

AudioFileSetProperty(audioID, kAudioFilePropertyAlbumArtwork,
(UInt32)[image length], [image bytes]);

--Kyle Sluder

 _______________________________________________
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: set kAudioFilePropertyAlbumArtwork: fail
      • From: Alex _ <email@hidden>
References: 
 >set kAudioFilePropertyAlbumArtwork: fail (From: Alex _ <email@hidden>)

  • Prev by Date: Audio Unit: BusCountWritable Problem
  • Next by Date: RE: set kAudioFilePropertyAlbumArtwork: fail
  • Previous by thread: set kAudioFilePropertyAlbumArtwork: fail
  • Next by thread: RE: set kAudioFilePropertyAlbumArtwork: fail
  • Index(es):
    • Date
    • Thread