• 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: How Do I Use NSCoding with Core Audio Data Types?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How Do I Use NSCoding with Core Audio Data Types?


  • Subject: Re: How Do I Use NSCoding with Core Audio Data Types?
  • From: n ketter <email@hidden>
  • Date: Fri, 21 Jun 2013 18:32:22 -0700

Thanks, yeah, I'm discovering that. 

I've decided to take the route of creating metadata about the audio graph - in types that can be archived - and then rebuilding the AUGraph on the fly.

Thanks again!


On Fri, Jun 21, 2013 at 6:04 PM, Kyle Sluder <email@hidden> wrote:
On Fri, Jun 21, 2013, at 05:04 PM, n ketter wrote:
> I've created a class that contains three properties that are Core Audio
> types:
>
>     @interface AudioFilePlayer : NSObject <NSCoding>
>
>     @property (assign) AudioUnit                        mAudioUnit;
>     @property (assign) AUNode                           mNode;
>     @property (assign) AudioStreamBasicDescription      mStreamFormat;
>
>     @end
>
> My app holds an array of objects of type AudioFilePlayer and I want to
> archive and unarchive them using NSCoding. I've written the
> encodeWithCoder: and initWithCoder: methods as follows:

You can't just willy-nilly archive raw bytes to disk and expect decoding
them to make any sense. AudioUnits and AUNodes are pointers into living
objects in an AU graph.

On the other hand, an AudioStreamBasicDescription is just a compendium
of values describing a particular file format, so it is okay to write
those values to disk. However, writing raw C structs to disk is a risky
proposition; you have to worry about padding, alignment, and endianness.

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

References: 
 >How Do I Use NSCoding with Core Audio Data Types? (From: n ketter <email@hidden>)
 >Re: How Do I Use NSCoding with Core Audio Data Types? (From: Kyle Sluder <email@hidden>)

  • Prev by Date: Re: How Do I Use NSCoding with Core Audio Data Types?
  • Next by Date: What happens if AVMutableComposition is mutated during playback?
  • Previous by thread: Re: How Do I Use NSCoding with Core Audio Data Types?
  • Next by thread: What happens if AVMutableComposition is mutated during playback?
  • Index(es):
    • Date
    • Thread