HERE iOS SDK Developer's Guide

NMAAudioOutput

Class Summary

class NMAAudioOutput

Derived from: NSObject

A single segment of audio output.

Include: NMAKit.framework/headers/NMAAudioOutput.h

Inheritance Diagrams

Figure 1. Public inheritance diagram for NMAAudioOutput

[For complete information, see the section Class Details]

See also:

NMAAudioFileOutput

NMATTSAudioOutput

NMAAudioManager

Public Property Summary

Table 1. Public Properties
Public Properties

[readable, writable, strong] NMAAudioOutputEventBlock   eventBlock

A block which provides user-defined behaviour in response to lifecycle events

[readable, writable, assign] NMAAudioOutputSource   source

The source of the audio output

[readable, writable, assign] float  volume

The playback volume in the range 0 to 1

Instance Method Summary

Table 2. Instance Methods
Instance Method Summary

-(nonnull instancetype) init

This is an abstract base class

-(void) play

Plays the audio output

-(void) stop

Stops the audio output

Class Details

A single segment of audio output.

NMAAudioOutput represents one cohesive segment of audio output; for example, a single sentence of TTS output or a single audio file. It is used with the NMAAudioManager to play audio in an application.

NMAAudioOutput is an abstract base class and should not be directly instantiated. Instead, subclasses which implement the required interface functions should be used.

For convenience, the NMAAudioFileOutput and NMATTSAudioOutput classes have been created for basic audio output functionality.

See also:

NMAAudioFileOutput

NMATTSAudioOutput

NMAAudioManager

Public Property Details

[readable, writable, strong] NMAAudioOutputEventBlock  eventBlock

A block which provides user-defined behaviour in response to lifecycle events.

The event block is typically defined by the object which created the audio output. It can be used for example to notify a listener when a given audio output starts and finishes.

The NMAAudioOutputEvent enum defines the types of events for which the block is called.

See also:

NMAAudioOutputEvent

[readable, writable, assign] NMAAudioOutputSource  source

The source of the audio output.

Audio output objects created by the application should use NMAAudioOutputSourceUser.

[readable, writable, assign] float volume

The playback volume in the range 0 to 1.0

This volume may be used to adjust volume level relative to other audio sources on the device (e.g. the music player) or within the application.

Defaults to 1.0 (full volume).

Subclasses should implement this method to adjust their volume appropriately. The super implementation may be called to clamp to the volume to the range 0 to 1.0.

Note:

This volume is applied as a multiplier to the "App" volume maintained by the OS. The latter can only be controlled by the physical volume keys or the iOS MPVolumeView UIControl.

Instance Method Details

-(nonnull instancetype) init

This is an abstract base class. Instances of this class should not be initialized directly.

-(void) play

Plays the audio output.

Note:

Subclasses must implement this method and call the super implementation at the beginning of the method.

-(void) stop

Stops the audio output.

Note:

Subclasses must implement this method and call the super implementation at the end of the method.