• 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
Audio Converter not accepting iLBC stream description for iOS 4+
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Audio Converter not accepting iLBC stream description for iOS 4+


  • Subject: Audio Converter not accepting iLBC stream description for iOS 4+
  • From: "Mr. William Mortimore" <email@hidden>
  • Date: Wed, 12 Oct 2011 13:51:13 -0500

I am updating an app that plays audio files with iLBC stream description. This new implementation is a simple Audio Graph with an Audio Converter node connected to a RemoteIO Node. 

Setting the input asbd  to the Audio Converter ("soundFileDataFormat" below) fails with -10868 (format not supported)  with simulator and devices above iOS 4.0 and succeeds below 4.0. My dump of the parameters ([self logASBD:]) at the end of the snippet below verifies that.

Is there no longer support for this codec in the AudioConverter? Using the AudioQueue services approach works in all iOS so the codec is in the iPhone, but I need Audio Units for latency issues that can't be solved with AudioQueue.

Code Snippet:

        NSLog(@"Start Play");
    
    OSStatus status;
    
    // set output data format
    
    UInt32 formatFlags = (0
                          | kAudioFormatFlagIsPacked 
                          | kAudioFormatFlagIsSignedInteger 
                          | kAudioFormatFlagsNativeEndian
                          );
    
    
    dataFormat.mFormatID = kAudioFormatLinearPCM;
    dataFormat.mFormatFlags = formatFlags;
    dataFormat.mSampleRate = 44100;
    dataFormat.mBitsPerChannel = 16;
    dataFormat.mChannelsPerFrame = 2;
    dataFormat.mBytesPerFrame = 4;
    dataFormat.mFramesPerPacket = 1;
    dataFormat.mBytesPerPacket = 4;
    
    soundFileDataFormat.mFormatID = kAudioFormatiLBC;
    soundFileDataFormat.mFormatFlags = 0;
    soundFileDataFormat.mSampleRate = 8000.0;
    soundFileDataFormat.mBitsPerChannel = 0;
    soundFileDataFormat.mChannelsPerFrame = 1;
    soundFileDataFormat.mBytesPerFrame = 0;
    soundFileDataFormat.mFramesPerPacket = 160;
    soundFileDataFormat.mBytesPerPacket = 38;

    
    NewAUGraph(&playGraph);
    
    // Add Remote IO output node
    
    AudioComponentDescription outputUnitDescription;
    outputUnitDescription.componentType = kAudioUnitType_Output;
    outputUnitDescription.componentSubType = kAudioUnitSubType_RemoteIO;
    outputUnitDescription.componentManufacturer = kAudioUnitManufacturer_Apple;    
    
    AUGraphAddNode(playGraph, &outputUnitDescription, &outputNode);
   
    // Add Converter
   
    AudioComponentDescription converterUnitDescription;
    converterUnitDescription.componentType = kAudioUnitType_FormatConverter;
    converterUnitDescription.componentSubType = kAudioUnitSubType_AUConverter;
    converterUnitDescription.componentManufacturer = kAudioUnitManufacturer_Apple;
  
     
    AUGraphAddNode(playGraph, &converterUnitDescription, &outputConverterNode);
    
    // Connect the nodes
    
    AUGraphConnectNodeInput(playGraph, outputConverterNode, 0,
                            outputNode, 0);
    
    // Open the graph
    
    AUGraphOpen(playGraph);
        
    status = AUGraphNodeInfo(playGraph, outputConverterNode,
                             NULL, &converterAudioUnit);
    if (status != noErr) {
        
        NSLog(@"Status = %ld", status);

        return FALSE;
    }
    
    outputConverter = (AudioConverterRef)converterAudioUnit;
            
    status = AudioUnitSetProperty(converterAudioUnit,
                                  kAudioUnitProperty_StreamFormat,
                                  kAudioUnitScope_Input,
                                  0,
                                  &soundFileDataFormat,
                                  sizeof(soundFileDataFormat));
    
    if (status != noErr) {
        
        NSLog(@"Status = %ld", status);
        
//        return FALSE;
    }
    
    UInt32 sizeofdata = sizeof(asbd); 
    
    status = AudioUnitGetProperty(converterAudioUnit,
                                  kAudioUnitProperty_StreamFormat,
                                  kAudioUnitScope_Input,
                                  0,
                                  &asbd, 
                                  &sizeofdata);
    
    [self logASBD:asbd];



Mr. William Mortimore
S76W13054 Cambridge Ct. W.
Muskego, WI 53150
414-841-6067
Fax:414-425-9155
email@hidden



 _______________________________________________
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

  • Prev by Date: How to use Time Code ?
  • Next by Date: Re : Big problems with Core Audio and OSX Lion : SynthNote does not work
  • Previous by thread: How to use Time Code ?
  • Next by thread: Re : Big problems with Core Audio and OSX Lion : SynthNote does not work
  • Index(es):
    • Date
    • Thread