Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Recording streaming audio from a online radio [closed]

Tags:

iphone

I am working on a application where I am playing a live radio from a url. I want to record the radio and save it to local file system.

like image 514
pankaj Avatar asked Jan 03 '11 11:01

pankaj


People also ask

How do I record audio from an online radio station?

Mobizen. Mobizen is a screen recorder that you can also use for recording internet radio. You capture any radio streaming and edit the same whenever you want. It comes with easy to start-stop recording feature that will let you record audio from radio stations without any hassle.

Can you record streamed audio?

A great way to record streaming audio online is to use a free online recording tool like Screen Capture. This web recorder lets you record audio on your device, ranging from short snippets and clips right up to lengthy music sequences.

Can VLC media player record streaming audio?

VLC Media Player is a free and open-source media player. You are allowed to record computer sound and microphone voice as well as the desktop screen with this screen and audio recorder. After recording, you are allowed to edit the recorded audio and share it on your platform.


1 Answers

This might help:

iPhone Coding: Recording Audio

You need to use CFURLRef to point to the file you want to record to. For example:

NSMutableString *fullpathname = @"/var/root/foo.amr";
CFURLRef url;
CFStringRef sref;

sref = CFStringCreateWithCString(nil, 
[fullpathname cStringUsingEncoding:
[NSString defaultCStringEncoding]],
kCFStringEncodingASCII);

url = CFURLCreateWithFileSystemPath(nil, sref, 
kCFURLPOSIXPathStyle, 0);

Start recording by initializing. Once you get this far, it's just a matter of bookkeeping to get your recorder started. Here's the relevant code. Allocate and initiate the recorder instance, activate it and assign it the CFURLRef URL you've created. Then tell it to start. Recording starts instantly.

// Start recording
recorder = [[AVRecorder alloc] init];
[recorder activate:self];
[recorder setFilePath:url];
[recorder start];

Stop the recording with "stop". When you're ready to finish recording, just send a stop message to your recorder and deactivate it. The file has already saved automatically to disk. If you want, you can query the number of bytes written before deactivating by sending a recordedFileSizeInBytes message.

[recorder stop];
[recorder deactivate];
like image 100
fulvio Avatar answered Oct 19 '22 05:10

fulvio