• 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: Audio stream using the toolbox
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Audio stream using the toolbox


  • Subject: Re: Audio stream using the toolbox
  • From: Chris Reed <email@hidden>
  • Date: Wed, 7 Apr 2004 22:50:35 -0500

Well, what error is the AudioFileCreate() call returning? That'd be the
first place to look for an answer.

-chris

On Apr 7, 2004, at 4:45 PM, Hotmail wrote:

> Hey,
>
> I've progressed on my work on the audio stream using the toolbox.
> It appears that I am accessing the stream.
>
> However, I am also attempting to create a new audio file. Then copy
> part of
> this stream into the new file. I'm doing my best with very little help
> from
> the help documents.
>
> I am wonder why a new audio file is not showing up on the desktop when
> I run
> the following code:
>
> AudioFileID outAudioFile;
> SInt8 inPermissions;
> inPermissions = 0x00;
>
> AudioFileOpen (
> &destFSRef,//const FSRef *inFileRef,
> inPermissions,
> 0,//UInt32 inFlags,
> &outAudioFile);
>
> float outBuffer[300];
> UInt32 ioNumBytes = 300 * sizeof(float);
>
> AudioFileReadBytes(
> outAudioFile,//AudioFileID inAudioFile,
> true,//Boolean inUseCache,
> 0,//SInt64 inStartingByte,
> &ioNumBytes,
> &outBuffer
> );
>
> UInt32 outDataSize;
> UInt32 isWritable;
>
> AudioFileGetPropertyInfo(
> outAudioFile,//AudioFileID inAudioFile,
> 'fmti',//AudioFilePropertyID inPropertyID,
> &outDataSize, //UInt32 *outDataSize,
> &isWritable //UInt32 *isWritable
> );
>
> AudioStreamBasicDescription ASBScurrentfile;
>
> AudioFileGetProperty(
> outAudioFile,//AudioFileID inAudioFile,
> 'fmti',//AudioFilePropertyID inPropertyID,
> &outDataSize, //UInt32 *ioDataSize,
> &ASBScurrentfile//void *outPropertyData
> );
>
> FSRef inParentRef;
> Boolean isDirectory;
>
> FSPathMakeRef (
> "/Users/lachlanbarratt/Desktop/",// const UInt8 * path,
> &inParentRef, //FSRef * ref,
> &isDirectory //Boolean * isDirectory
> );
>
> CFStringRef inFileName;
> FSRef outNewFileRef;
> AudioFileID outAudioFile2;
>
> inFileName = CFSTR("NewAudioFile");
>
> AudioFileCreate(
> &inParentRef, //const FSRef *inParentRef,
> inFileName,//CFStringRef inFileName,
> 'AIFF',//UInt32 inFileType,
> &ASBScurrentfile, //const AudioStreamBasicDescription *inFormat,
> 0, //UInt32 inFlags,
> &outNewFileRef, //FSRef *outNewFileRef,
> &outAudioFile2 //AudioFileID *outAudioFile
> );
>
> AudioFileWriteBytes(
> outAudioFile2,//AudioFileID inAudioFile,
> true, //Boolean inUseCache,
> 0, //SInt64 inStartingByte,
> &ioNumBytes, //UInt32 *ioNumBytes,
> &outBuffer //void *inBuffer
> );
>
>
> AudioFileClose(outAudioFile);
> AudioFileClose(outAudioFile2);
>
>
> Thank you for your time.
> _______________________________________________
> coreaudio-api mailing list | email@hidden
> Help/Unsubscribe/Archives:
> http://www.lists.apple.com/mailman/listinfo/coreaudio-api
> Do not post admin requests to the list. They will be ignored.

[demime 0.98b removed an attachment of type application/pkcs7-signature which had a name of smime.p7s]
_______________________________________________
coreaudio-api mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/coreaudio-api
Do not post admin requests to the list. They will be ignored.


References: 
 >Audio stream using the toolbox (From: Hotmail <email@hidden>)

  • Prev by Date: Audio stream using the toolbox
  • Next by Date: AudioConverterFillComplexBuffer and temporary stream exhaustion
  • Previous by thread: Audio stream using the toolbox
  • Next by thread: AudioConverterFillComplexBuffer and temporary stream exhaustion
  • Index(es):
    • Date
    • Thread