Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3782462
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T11:05:10+00:00 2026-05-19T11:05:10+00:00

Is there a way to save iPod music files to iPhone App using iPhone

  • 0

Is there a way to save iPod music files to iPhone App using iPhone SDK?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-19T11:05:11+00:00Added an answer on May 19, 2026 at 11:05 am

    i show audio list on table view when i click on audio tableview then that song i hold in nsdata for upload

    -(void)startVideoStart:(NSNumber*)number
    
    {
    
        MPMediaItem *song = [miPodSongsArray objectAtIndex:[number intValue]];
    
        songTitle = [song valueForProperty: MPMediaItemPropertyTitle];
    
        NSURL *url = [song valueForProperty:MPMediaItemPropertyAssetURL];
    
        [NSThread detachNewThreadSelector:@selector(loadAudioInBackground:) toTarget:self withObject:url];
    
        [self performSelector:@selector(UploadSong:) withObject:songDict afterDelay:10];
    
    }
    
    -(void)loadAudioInBackground:(NSURL*)url
    
    {
    
        NSAutoreleasePool *pool = [[NSAutoreleasePool alloc]init];
    
        NSLog(@"%@",url);
    
        AVURLAsset *songAsset = [AVURLAsset URLAssetWithURL: url options:nil];
    
        NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
    
        NSString *documentsDirectory = [paths objectAtIndex:0];
    
        NSLog (@"compatible presets for songAsset: %@",[AVAssetExportSession exportPresetsCompatibleWithAsset:songAsset]);
    
        AVAssetExportSession *exporter = [[AVAssetExportSession alloc]
                                      initWithAsset: songAsset
                                      presetName: AVAssetExportPresetPassthrough];
    
        NSLog (@"created exporter. supportedFileTypes: %@", exporter.supportedFileTypes);
    
        exporter.outputFileType = @"com.apple.m4a-audio";
    
        NSString *exportFile = [documentsDirectory stringByAppendingPathComponent: @"item.m4a"];
    
        NSError *error1;
    
        if([[NSFileManager defaultManager] fileExistsAtPath:exportFile]) 
        {
    
            [[NSFileManager defaultManager] removeItemAtPath:exportFile error:&error1];
        }
    
        NSURL* exportURL = [[NSURL fileURLWithPath:exportFile] retain];
    
        exporter.outputURL = exportURL; 
    
        // do the export
        [exporter exportAsynchronouslyWithCompletionHandler:^{
    
            NSData *data1 = [NSData dataWithContentsOfFile: [documentsDirectory stringByAppendingPathComponent: @"item.m4a"]];
    
            //NSLog(@"%@",data1);
    
            if (songDict) {
    
                [songDict release];
    
                songDict=nil;
    
            }
    
            songDict= [[NSMutableDictionary alloc]init];
    
            [songDict setValue:data1 forKey:@"AudioData"];
    
            [songDict setValue:songTitle forKey:@"AudioName"];
    
            [songDict setValue:[[mAppDelegate.userInfoArray objectAtIndex:1]valueForKey:@"user_id"] forKey:@"user_id"];
    
            //NSLog(@"%@",infoDict);
    
            mAppDelegate.uploadType = @"Audio";
    
            int exportStatus = exporter.status;
    
            switch (exportStatus) {
    
                case AVAssetExportSessionStatusFailed: {
    
                    // log error to text view
                    NSError *exportError = exporter.error;
    
                    NSLog (@"AVAssetExportSessionStatusFailed: %@", exportError);
    
                    //      errorView.text = exportError ? [exportError description] : @"Unknown failure";
    
                    //errorView.hidden = NO;
    
                    break;
                }
    
                case AVAssetExportSessionStatusCompleted: {
    
                    NSLog (@"AVAssetExportSessionStatusCompleted");
    
                    break;
                }
    
                case AVAssetExportSessionStatusUnknown: { NSLog (@"AVAssetExportSessionStatusUnknown");
    break; } case AVAssetExportSessionStatusExporting: { NSLog (@"AVAssetExportSessionStatusExporting"); break; }
    
        case AVAssetExportSessionStatusCancelled: { NSLog (@"AVAssetExportSessionStatusCancelled");
        break; }
    
        case AVAssetExportSessionStatusWaiting: { NSLog (@"AVAssetExportSessionStatusWaiting"); break; }
    
            default: 
        { NSLog (@"didn't get export status"); break; } }
    
        }];
    
        [pool release];
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Is there a way to save a file in HDFS using MapR distribution of
is there a way that I can save the model by using dictionary for
is there any way to save a PDF as an image using ZendFramework? I'm
Just like the way we save the instance variables using serialization, is there any
Is there a way to save Properties in Java with some formatting using the
Is there a way to save files without asking in Eclipse? Every time I
Is there any way to save data without connecting to server on the iPhone?
is there a way to save, not save as, from an online flex app
Is there any way to save the state of vim settings with a document?
Is there any way to save my code folding in eclipse? It's horrible to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.