Advertise Books Events Forum News Social Networking Support Us

sdkIQ for iPhone
($4.99)

Shape Up
($0.99)

Your First iPhone App
($1.99)

iVidCam Free
(free)

Kid Art
($0.99)

iPUBQUIZ
(£1.19)

ArtStudio
($3.99)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum

View Single Post
Old 06-23-2009, 03:56 PM   #8 (permalink)
smithdale87
Magic Hands' Daddy
 
Join Date: Aug 2008
Location: Memphis, TN, USA
Age: 22
Posts: 1,372
Send a message via ICQ to smithdale87 Send a message via AIM to smithdale87 Send a message via Skype™ to smithdale87
Default

This should get you on the right track. Mix and match pseudo code

Code:
-(void) concatFiles( NSString* path1, NSString* path2, NSString* combinedPath )
{
 NSFileHandle * f1Handle = [NSFileHandle fileHandleForReadingAtPath: path1];
 NSFileHandle *f2Handle = [NSFileHandle fielHandleForReadingAtPath: path2];

//might need to check if file exists first, if not create it using NSFileManager's createFileAtPath

 NSFileHandle * combinedHandle = [NSFileHandle fileHandleForWritingAtPath: combinedPath];



   // read data in small chunks to avoid hogging memory. 
   NSData* read  = [f1Handle readDataOfLength: CHUNK_SIZE] ;
      
    while( length of read != 0 )   

   {
       [combineHandle writeData: read];
       read = [f1Handle readDataOfLength: CHUNK_SIZE] ;
   }


   [f1Handle close];
   

    //now do the same for f2Handle

    //might need to ignore a few bytes in the front of file2 that isnt audio
    [f2Handle readDataOfLength: HEADER_LENGTH];


     NSData* read  = [f2Handle readDataOfLength: CHUNK_SIZE] ;
     while (... )
    {
    }
     [f2Handle close];
     [combineHandle close];
  
}
__________________
Games
AppRoach - (v1.0)
7 Deaths In Nagamachi (v1.1)
Segment (v1.2)
ThumStruck Free (v1.5)
Plummet - new (v1.0)
ThumStruck 2! - Coming Soon

Apps
ArtsMemphis - (v1.0)
Elvis Mobile (v1.1)
DataLoss DB - (v1.1)
Lovers & Haters - (v1.0)
smithdale87 is offline   Reply With Quote
 
Enter the iPhone App Challenge!  Win $500!
» Advertisements
» Stats
Members: 24,181
Threads: 38,954
Posts: 170,899
Top Poster: smasher (2,565)
Welcome to our newest member, Zephyros
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 08:29 AM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.