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

  • SEARCH
  • Home
  • 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 3782306
In Process

The Archive Base Latest Questions

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

Can we store ipod music library file (song) to iPhone App folder? if Yes

  • 0

Can we store ipod music library file (song) to iPhone App folder?
if Yes Please suggest How can I do that?

Please Help

Thanks

  • 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:03:52+00:00Added an answer on May 19, 2026 at 11:03 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

I am working to create an iPhone app to store documents from the device(iPhone/iPod
i have an iphone app that uses coredata to store its contents. users often
I have a file that can store up to 8 bytes of data. I
I'm wondering how many images I can store in the iPhone documents directory so
I need to store user credentials in my app. I can store and retrieve
Say that I've got a web application that can store Persons in a database.
Is there a class in the .NET BCL that can store a block of
I'm building an app for the iPhone and the app is only for iPod
I desperately need help with a memory leak in my iPhone app. The app
I need to start playing a song (which is in the iPod library) in

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.