Re: Trimming audio
Re: Trimming audio
- Subject: Re: Trimming audio
- From: tahome izwah <email@hidden>
- Date: Fri, 13 Feb 2009 11:30:52 +0100
This code doesn't make sense (to me) in a number of ways... for one
thing you're trying to write data that are supposed to be in newBuffer
but you never allocate this buffer nor do you assign the pointer
anywhere in your code. Also, you never open the files that you try to
read from or write to (at least not in the code snippet that you
posted).
--th
2009/2/13 Santosh Kumar <email@hidden>:
> Hi ,
> Here is my code.Here i am writing content of first file to second but second
> file doesn't contain any data.
> NSData *pcmData = [NSData dataWithContentsOfFile:sourceFile];
> unsigned int length = [pcmData length] / sizeof( float );
> UInt32 inBytesLength = length * audioFormat.mBytesPerFrame;
> UInt32 maxPacketSize;
> UInt32 propertySize = sizeof (maxPacketSize);
> AudioFileGetProperty (
> audioFileID,
> kAudioFilePropertyPacketSizeUpperBound,
> &propertySize,
> &maxPacketSize
> );
> SInt16 startingByte = 0;
> void *Buffer = malloc(inBytesLength);
> void *newBuffer;
> sts = AudioFileReadBytes(fileID,
> NO,
> startingByte,
> &inBytesLength,
> Buffer);
> //Writing part
> AudioFileWriteBytes(newFileID,
> NO,
> startingByte,
> &inBytesLength,
> newBuffer);
>
> Regards,
> Santosh Kumar
>
_______________________________________________
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