NTAudioSource Class Reference

Inherits from NSObject
Declared in NTAudioSource.h
NTAudioSource.m

Overview

Base class for nn audio source. This is a component that produces audio data (e.g. reading from mic).

Default Audio Format is Mono 16Bit PCM 16000 rate

Other Methods

  started

Whether the audio source currently produces data.

@property (nonatomic, readonly) BOOL started

Discussion

Whether the audio source currently produces data.

Declared In

NTAudioSource.h

  suspended

Whether the audio source is suspended.

@property (nonatomic, readonly) BOOL suspended

Discussion

Whether the audio source is suspended.

Declared In

NTAudioSource.h

  format

The format of the audio data, this source is producing.

@property (nonatomic, readonly) AudioStreamBasicDescription format

Discussion

The format of the audio data, this source is producing.

Declared In

NTAudioSource.h

– initWithFormat:

Create a source with the given format.

- (instancetype)initWithFormat:(AudioStreamBasicDescription)format

Parameters

format

Format

Return Value

instance

Discussion

Create a source with the given format.

Declared In

NTAudioSource.h

– start

Start producing audio.

- (BOOL)start

Return Value

YES on success, NO otherwise

Discussion

Start producing audio.

Declared In

NTAudioSource.h

– suspend

Suspend producing audio.

- (BOOL)suspend

Return Value

YES on success, NO otherwise

Discussion

Suspend producing audio.

Declared In

NTAudioSource.h

– resume

Resume producing audio.

- (BOOL)resume

Return Value

YES on success, NO otherwise

Discussion

Resume producing audio.

Declared In

NTAudioSource.h

– stop

Stop producing audio.

- (BOOL)stop

Return Value

YES on success, NO otherwise

Discussion

Stop producing audio.

Declared In

NTAudioSource.h

– addDelegate:

Adds a delegate

- (void)addDelegate:(id<NTAudioSourceDelegate>)delegate

Parameters

delegate

delegate

Discussion

Adds a delegate

Declared In

NTAudioSource.h

– removeDelegate:

Removes a delegate

- (void)removeDelegate:(id<NTAudioSourceDelegate>)delegate

Parameters

delegate

delegate

Discussion

Removes a delegate

Declared In

NTAudioSource.h

– notifyDelegatesDidReadData:

Only for subclasses. Notifies all delegates that new data is available.

- (void)notifyDelegatesDidReadData:(NSData *)data

Parameters

data

Data

Discussion

Only for subclasses. Notifies all delegates that new data is available.

Declared In

NTAudioSource.h

+ monoPCM16kInt16

Audio Format with the following settings: Sample Rate = 16'000 Format = Linear PCM Channels = 1 Bits per Channel = 16 Little Endian Signed Int Non interleaved

+ (AudioStreamBasicDescription)monoPCM16kInt16

Return Value

Format Description

Discussion

Audio Format with the following settings: Sample Rate = 16'000 Format = Linear PCM Channels = 1 Bits per Channel = 16 Little Endian Signed Int Non interleaved

Declared In

NTAudioSource.h

Other Methods

– init

- (instancetype)init

Extension Methods

  delegates

@property (nonatomic, strong) NSHashTable *delegates