MusicKit  0.0.0
Public Member Functions | Protected Attributes
SndStreamRecorder Class Reference

Records incoming audio to a sound file. More...

#import <SndStreamRecorder.h>

Inheritance diagram for SndStreamRecorder:
SndStreamClient SndStreamClient

List of all members.

Public Member Functions

(id) - init
 Initialiser.
(NSString *) - description
(BOOL) - startRecording
(BOOL) - startRecordingToFile:
 Starts the record-to-disk routines.
(void) - stopRecording
 Stops the recording to file.
(void) - stopRecordingAndDisconnectFromStream:
 Stops the recording to file. Optionally stay connected to the stream.
(id) - init
 Initialiser.
(NSString *) - description
(BOOL) - startRecording
(BOOL) - startRecordingToFile:
 Starts the record-to-disk routines.
(void) - stopRecording
 Stops the recording to file.
(void) - stopRecordingAndDisconnectFromStream:
 Stops the recording to file. Optionally stay connected to the stream.

Protected Attributes

SndAudioProcessorRecorderrecorder

Detailed Description

Records incoming audio to a sound file.

ATTENTION!!! Presumptions made to get this class off the ground quickly: The incoming stream is made of 32-bit floats, and the saved file is made of 16-bit ints!

BIG TODO: general purpose format stuff

Using the client currently requires an explicit connect-to-stream manager call:

SndStreamRecorder *rec = [SndStreamRecorder streamRecorder]; [[SndStreamManager defaultStreamManager] addClient: rec];

then either...

[rec startRecordingToFile: "/tmp/incomingsound.snd"]; (time passes...) [rec stopRecording];

or:

[rec prepareForRecording: 10.5]; //record for 10.5 seonds [rec startRecording];

TODO:


Member Function Documentation

- (NSString*) description
Returns:
NSString with description

Reimplemented from SndStreamClient.

- (NSString*) description
Returns:
NSString with description

Reimplemented from SndStreamClient.

- (id) init

Initialiser.

Returns:
self
- (id) init

Initialiser.

Returns:
self
- (BOOL) startRecording
Returns:
Boolean indicating success
- (BOOL) startRecording
Returns:
Boolean indicating success
- (BOOL) startRecordingToFile: (NSString *)  filename

Starts the record-to-disk routines.

Parameters:
filename
Returns:
Boolean indicating success
- (BOOL) startRecordingToFile: (NSString *)  filename

Starts the record-to-disk routines.

Parameters:
filename
Returns:
Boolean indicating success
- (void) stopRecording

Stops the recording to file.

The recorder instance will wait for intermediate buffers to be flushed to disk. The recorder will then disconnect from the stream.

- (void) stopRecording

Stops the recording to file.

The recorder instance will wait for intermediate buffers to be flushed to disk. The recorder will then disconnect from the stream.

- (void) stopRecordingAndDisconnectFromStream: (BOOL)  bDisconnectFromStream

Stops the recording to file. Optionally stay connected to the stream.

For internal use only.

Parameters:
bDisconnectFromStreamTRUE if you want the client to disconnect from the stream manager, FALSE otherwise. Leaving the client connected ensures the audio streams stay open, and minimizes start-recording set-up time. Downside is a slight CPU hit from the background streaming going on.
- (void) stopRecordingAndDisconnectFromStream: (BOOL)  bDisconnectFromStream

Stops the recording to file. Optionally stay connected to the stream.

For internal use only.

Parameters:
bDisconnectFromStreamTRUE if you want the client to disconnect from the stream manager, FALSE otherwise. Leaving the client connected ensures the audio streams stay open, and minimizes start-recording set-up time. Downside is a slight CPU hit from the background streaming going on.

Member Data Documentation

A stream recording FX processor


The documentation for this class was generated from the following files: