• 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: Trimming audio
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

  • Follow-Ups:
    • Re: Trimming audio
      • From: Santosh Kumar <email@hidden>
  • Prev by Date: Re: Plugin delay compensation
  • Next by Date: Re: Trimming audio
  • Previous by thread: Re: Trimming audio
  • Next by thread: Re: Trimming audio
  • Index(es):
    • Date
    • Thread