• 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
Streaming a file as it gets recorded?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Streaming a file as it gets recorded?


  • Subject: Streaming a file as it gets recorded?
  • From: "ben levitt" <email@hidden>
  • Date: Fri, 4 Jan 2008 13:57:00 -0800

Sorry my first email went out prematurely...

Anyhoo, I'm trying to stream an audio file up to a server as it gets
recorded, using NSMutableURLRequest and an NSInputStrem.  The problem
I'm having is that if I start streaming while the file is still
getting recorded, then I only end up sending the beginning of the
file, and as soon as sending catches up to recording, the transfer
stops.

Is there a nice, simple way to get the file to continue streaming
until it's done being written?

I'm trying to do something like the following.

NSURL *cgiUrl = [NSURL URLWithString: urlStr];
NSMutableURLRequest *postRequest = [NSMutableURLRequest requestWithURL:cgiUrl];

//setting the headers:
[postRequest setHTTPMethod:@"POST"];
[postRequest addValue: @"application/octet-stream" forHTTPHeaderField:
@"Content-Type"];

//adding the body:
fileStream = [[NSInputStream inputStreamWithFileAtPath: recordingFile] retain];
[postRequest setHTTPBodyStream: fileStream];

// Make the request
NSURLConnection *theConnection=[[NSURLConnection alloc]
initWithRequest:postRequest:  delegate:self];


Thanks,
Ben
_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Prev by Date: Mouse tracking in CALayer
  • Next by Date: Re: iChat-Theater not working from Cocoa apps
  • Previous by thread: Re: Mouse tracking in CALayer
  • Next by thread: Image scaling
  • Index(es):
    • Date
    • Thread