• 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
usage of afconvert with NSTask
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

usage of afconvert with NSTask


  • Subject: usage of afconvert with NSTask
  • From: "email@hidden" <email@hidden>
  • Date: Thu, 14 Oct 2010 12:02:59 +0200

Hi,

I want to use the afconvert utility to convert files to aifc inside of my application using NSTask.
In the terminal it works with :
afconvert /Users/book/Desktop/test.wav -d BEI24 /Users/book/Desktop/test.aifc

In Xcode I have a problem with the arguments, I get  messages like:
" missing argument to '-d' option"
"Couldn't infer file format from data format  1 ch,  0 Hz, 'lpcm' (0x0000000E) 24-bit big-endian signed integer"
"Error: Couldn't open input file (-43)"

Can anybody please tell me how to set up the arguments correctly ?
Or does somebody have a working example ?

Thank you 

Karsten


-(void) aifcgenerator 

{
PathName = [paths objectAtIndex:0];   // Pathname and path are global
 NSTask *aifctask = [[[NSTask alloc] init] autorelease];
  
[aifctask setStandardOutput: [NSPipe pipe]];
    [aifctask setStandardError: [aifctask standardOutput]];
    [aifctask setLaunchPath:@"/usr/bin/afconvert"];
[aifctask setArguments:
 [NSArray arrayWithObjects:
  @"-d",
  @"BEI24",
  @"F32@44100",
  PathName,
    nil
  ]
 ];
      [aifctask launch];
      NSData *data ="" alloc] init];
data = "" standardOutput] fileHandleForReading] availableData];
[data writeToFile:derPfad atomically:NO];
       [aifctask terminate];
[aifctask release];
}


afconvert help:

Usage:
afconvert [option...] input_file [output_file]
    Options may appear before or after the direct arguments. If output_file
    is not specified, a name is generated programmatically and the file
    is written into the same directory as input_file.
afconvert input_file [-o output_file [option...]]...
    Output file options apply to the previous output_file. Other options
    may appear anywhere.
 _______________________________________________
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: usage of afconvert with NSTask
      • From: tahome izwah <email@hidden>
    • Re: usage of afconvert with NSTask
      • From: Doug Wyatt <email@hidden>
  • Prev by Date: Re: Virtual audio device glitches
  • Next by Date: openAL engine clips
  • Previous by thread: Restarting a remoteIO unit soon after stopping it
  • Next by thread: Re: usage of afconvert with NSTask
  • Index(es):
    • Date
    • Thread