public class AVAudioPlayerNode extends AVAudioNode implements AVAudioMixing
Play buffers or segments of audio files.
AVAudioPlayerNode supports scheduling the playback of `AVAudioBuffer` instances, or segments of audio files opened via `AVAudioFile`. Buffers and segments may be scheduled at specific points in time, or to play immediately following preceding segments.
FORMATS
Normally, you will want to configure the node's output format with the same number of channels as are in the files and buffers to be played. Otherwise, channels will be dropped or added as required. It is usually better to use an `AVAudioMixerNode` to do this.
Similarly, when playing file segments, the node will sample rate convert if necessary, but it is often preferable to configure the node's output sample rate to match that of the file(s) and use a mixer to perform the rate conversion.
When playing buffers, there is an implicit assumption that the buffers are at the same sample rate as the node's output format.
TIMELINES
The usual `AVAudioNode` sample times (as observed by `lastRenderTime`) have an arbitrary zero point. AVAudioPlayerNode superimposes a second "player timeline" on top of this, to reflect when the player was started, and intervals during which it was paused. The methods `nodeTimeForPlayerTime:` and `playerTimeForNodeTime:` convert between the two.
This class' `stop` method unschedules all previously scheduled buffers and file segments, and returns the player timeline to sample time 0.
TIMESTAMPS
The "schedule" methods all take an `AVAudioTime` "when" parameter. This is interpreted as follows:
1. nil: - if there have been previous commands, the new one is played immediately following the last one. - otherwise, if the node is playing, the event is played in the very near future. - otherwise, the command is played at sample time 0. 2. sample time: - relative to the node's start time (which begins at 0 when the node is started). 3. host time: - ignored unless the sample time is invalid when the engine is rendering to an audio device. - ignored in manual rendering mode.
ERRORS
The "schedule" methods can fail if:
1. a buffer's channel count does not match that of the node's output format. 2. a file can't be accessed. 3. an AVAudioTime specifies neither a valid sample time or host time. 4. a segment's start frame or frame count is negative.
BUFFER/FILE COMPLETION HANDLERS
The buffer or file completion handlers (see scheduling methods) are a means to schedule more data if available on the player node. See `AVAudioPlayerNodeCompletionCallbackType` for details on the different buffer/file completion callback types.
Note that a player should not be stopped from within a completion handler callback because it can deadlock while trying to unschedule previously scheduled buffers.
OFFLINE RENDERING
When a player node is used with the engine operating in the manual rendering mode, the buffer/file completion handlers, `lastRenderTime` and the latencies (`latency` and `outputPresentationLatency`) can be used to track how much data the player has rendered and how much more data is left to render.
| Modifier and Type | Class and Description |
|---|---|
static interface |
AVAudioPlayerNode.Block_scheduleBufferAtTimeOptionsCompletionCallbackTypeCompletionHandler |
static interface |
AVAudioPlayerNode.Block_scheduleBufferAtTimeOptionsCompletionHandler |
static interface |
AVAudioPlayerNode.Block_scheduleBufferCompletionCallbackTypeCompletionHandler |
static interface |
AVAudioPlayerNode.Block_scheduleBufferCompletionHandler |
static interface |
AVAudioPlayerNode.Block_scheduleFileAtTimeCompletionCallbackTypeCompletionHandler |
static interface |
AVAudioPlayerNode.Block_scheduleFileAtTimeCompletionHandler |
static interface |
AVAudioPlayerNode.Block_scheduleSegmentStartingFrameFrameCountAtTimeCompletionCallbackTypeCompletionHandler |
static interface |
AVAudioPlayerNode.Block_scheduleSegmentStartingFrameFrameCountAtTimeCompletionHandler |
AVAudioNode.Block_installTapOnBusBufferSizeFormatBlockNSObject.Function_instanceMethodForSelector_ret, NSObject.Function_methodForSelector_ret| Modifier | Constructor and Description |
|---|---|
protected |
AVAudioPlayerNode(org.moe.natj.general.Pointer peer) |
| Modifier and Type | Method and Description |
|---|---|
static boolean |
accessInstanceVariablesDirectly() |
static AVAudioPlayerNode |
alloc() |
static AVAudioPlayerNode |
allocWithZone(org.moe.natj.general.ptr.VoidPtr zone) |
static boolean |
automaticallyNotifiesObserversForKey(java.lang.String key) |
static void |
cancelPreviousPerformRequestsWithTarget(java.lang.Object aTarget) |
static void |
cancelPreviousPerformRequestsWithTargetSelectorObject(java.lang.Object aTarget,
org.moe.natj.objc.SEL aSelector,
java.lang.Object anArgument) |
static NSArray<java.lang.String> |
classFallbacksForKeyedArchiver() |
static org.moe.natj.objc.Class |
classForKeyedUnarchiver() |
static java.lang.String |
debugDescription_static() |
static java.lang.String |
description_static() |
AVAudioMixingDestination |
destinationForMixerBus(AVAudioNode mixer,
long bus)
Returns the AVAudioMixingDestination object corresponding to specified mixer node and
its input bus
|
static long |
hash_static() |
AVAudioPlayerNode |
init() |
static NSObject.Function_instanceMethodForSelector_ret |
instanceMethodForSelector(org.moe.natj.objc.SEL aSelector) |
static NSMethodSignature |
instanceMethodSignatureForSelector(org.moe.natj.objc.SEL aSelector) |
static boolean |
instancesRespondToSelector(org.moe.natj.objc.SEL aSelector) |
boolean |
isPlaying()
[@property] playing
|
static boolean |
isSubclassOfClass(org.moe.natj.objc.Class aClass) |
static NSSet<java.lang.String> |
keyPathsForValuesAffectingValueForKey(java.lang.String key) |
static AVAudioPlayerNode |
new_objc() |
AVAudioTime |
nodeTimeForPlayerTime(AVAudioTime playerTime)
nodeTimeForPlayerTime:
|
float |
obstruction()
[@property] obstruction
|
float |
occlusion()
[@property] occlusion
|
float |
pan()
[@property] pan
|
void |
pause()
pause
|
void |
play()
play
|
void |
playAtTime(AVAudioTime when)
playAtTime:
|
AVAudioTime |
playerTimeForNodeTime(AVAudioTime nodeTime)
playerTimeForNodeTime:
|
long |
pointSourceInHeadMode()
[@property] pointSourceInHeadMode
|
AVAudio3DPoint |
position()
[@property] position
|
void |
prepareWithFrameCount(int frameCount)
prepareWithFrameCount:
|
float |
rate()
[@property] rate
|
long |
renderingAlgorithm()
[@property] renderingAlgorithm
|
static boolean |
resolveClassMethod(org.moe.natj.objc.SEL sel) |
static boolean |
resolveInstanceMethod(org.moe.natj.objc.SEL sel) |
float |
reverbBlend()
[@property] reverbBlend
|
void |
scheduleBufferAtTimeOptionsCompletionCallbackTypeCompletionHandler(AVAudioPCMBuffer buffer,
AVAudioTime when,
long options,
long callbackType,
AVAudioPlayerNode.Block_scheduleBufferAtTimeOptionsCompletionCallbackTypeCompletionHandler completionHandler)
scheduleBuffer:atTime:options:completionCallbackType:completionHandler:
|
void |
scheduleBufferAtTimeOptionsCompletionHandler(AVAudioPCMBuffer buffer,
AVAudioTime when,
long options,
AVAudioPlayerNode.Block_scheduleBufferAtTimeOptionsCompletionHandler completionHandler)
scheduleBuffer:atTime:options:completionHandler:
|
void |
scheduleBufferCompletionCallbackTypeCompletionHandler(AVAudioPCMBuffer buffer,
long callbackType,
AVAudioPlayerNode.Block_scheduleBufferCompletionCallbackTypeCompletionHandler completionHandler)
scheduleBuffer:completionCallbackType:completionHandler:
|
void |
scheduleBufferCompletionHandler(AVAudioPCMBuffer buffer,
AVAudioPlayerNode.Block_scheduleBufferCompletionHandler completionHandler)
scheduleBuffer:completionHandler:
|
void |
scheduleFileAtTimeCompletionCallbackTypeCompletionHandler(AVAudioFile file,
AVAudioTime when,
long callbackType,
AVAudioPlayerNode.Block_scheduleFileAtTimeCompletionCallbackTypeCompletionHandler completionHandler)
scheduleFile:atTime:completionCallbackType:completionHandler:
|
void |
scheduleFileAtTimeCompletionHandler(AVAudioFile file,
AVAudioTime when,
AVAudioPlayerNode.Block_scheduleFileAtTimeCompletionHandler completionHandler)
scheduleFile:atTime:completionHandler:
|
void |
scheduleSegmentStartingFrameFrameCountAtTimeCompletionCallbackTypeCompletionHandler(AVAudioFile file,
long startFrame,
int numberFrames,
AVAudioTime when,
long callbackType,
AVAudioPlayerNode.Block_scheduleSegmentStartingFrameFrameCountAtTimeCompletionCallbackTypeCompletionHandler completionHandler)
scheduleSegment:startingFrame:frameCount:atTime:completionCallbackType:completionHandler:
|
void |
scheduleSegmentStartingFrameFrameCountAtTimeCompletionHandler(AVAudioFile file,
long startFrame,
int numberFrames,
AVAudioTime when,
AVAudioPlayerNode.Block_scheduleSegmentStartingFrameFrameCountAtTimeCompletionHandler completionHandler)
scheduleSegment:startingFrame:frameCount:atTime:completionHandler:
|
void |
setObstruction(float value)
[@property] obstruction
|
void |
setOcclusion(float value)
[@property] occlusion
|
void |
setPan(float value)
[@property] pan
|
void |
setPointSourceInHeadMode(long value)
[@property] pointSourceInHeadMode
|
void |
setPosition(AVAudio3DPoint value)
[@property] position
|
void |
setRate(float value)
[@property] rate
|
void |
setRenderingAlgorithm(long value)
[@property] renderingAlgorithm
|
void |
setReverbBlend(float value)
[@property] reverbBlend
|
void |
setSourceMode(long value)
[@property] sourceMode
|
static void |
setVersion_static(long aVersion) |
void |
setVolume(float value)
[@property] volume
|
long |
sourceMode()
[@property] sourceMode
|
void |
stop()
stop
|
static org.moe.natj.objc.Class |
superclass_static() |
static long |
version_static() |
float |
volume()
[@property] volume
|
AUAudioUnit, engine, inputFormatForBus, installTapOnBusBufferSizeFormatBlock, lastRenderTime, latency, nameForInputBus, nameForOutputBus, numberOfInputs, numberOfOutputs, outputFormatForBus, outputPresentationLatency, removeTapOnBus, resetaccessibilityActivate, accessibilityActivationPoint, accessibilityAssistiveTechnologyFocusedIdentifiers, accessibilityAttributedHint, accessibilityAttributedLabel, accessibilityAttributedUserInputLabels, accessibilityAttributedValue, accessibilityContainerType, accessibilityCustomActions, accessibilityCustomRotors, accessibilityDecrement, accessibilityDragSourceDescriptors, accessibilityDropPointDescriptors, accessibilityElementAtIndex, accessibilityElementCount, accessibilityElementDidBecomeFocused, accessibilityElementDidLoseFocus, accessibilityElementIsFocused, accessibilityElements, accessibilityElementsHidden, accessibilityFrame, accessibilityHint, accessibilityIncrement, accessibilityLabel, accessibilityLanguage, accessibilityNavigationStyle, accessibilityPath, accessibilityPerformEscape, accessibilityPerformMagicTap, accessibilityRespondsToUserInteraction, accessibilityScroll, accessibilityTextualContext, accessibilityTraits, accessibilityUserInputLabels, accessibilityValue, accessibilityViewIsModal, addObserverForKeyPathOptionsContext, attemptRecoveryFromErrorOptionIndex, attemptRecoveryFromErrorOptionIndexDelegateDidRecoverSelectorContextInfo, autoContentAccessingProxy, awakeAfterUsingCoder, awakeFromNib, class_objc, classForCoder, classForKeyedArchiver, copy, dealloc, debugDescription, description, dictionaryWithValuesForKeys, didChangeValueForKey, didChangeValueForKeyWithSetMutationUsingObjects, didChangeValuesAtIndexesForKey, doesNotRecognizeSelector, fileManagerShouldProceedAfterError, fileManagerWillProcessPath, finalize_objc, forwardingTargetForSelector, forwardInvocation, hash, indexOfAccessibilityElement, isAccessibilityElement, isEqual, isKindOfClass, isMemberOfClass, isProxy, methodForSelector, methodSignatureForSelector, mutableArrayValueForKey, mutableArrayValueForKeyPath, mutableCopy, mutableOrderedSetValueForKey, mutableOrderedSetValueForKeyPath, mutableSetValueForKey, mutableSetValueForKeyPath, observationInfo, observeValueForKeyPathOfObjectChangeContext, performSelector, performSelectorInBackgroundWithObject, performSelectorOnMainThreadWithObjectWaitUntilDone, performSelectorOnMainThreadWithObjectWaitUntilDoneModes, performSelectorOnThreadWithObjectWaitUntilDone, performSelectorOnThreadWithObjectWaitUntilDoneModes, performSelectorWithObject, performSelectorWithObjectAfterDelay, performSelectorWithObjectAfterDelayInModes, performSelectorWithObjectWithObject, prepareForInterfaceBuilder, provideImageDataBytesPerRowOrigin_Size_UserInfo, removeObserverForKeyPath, removeObserverForKeyPathContext, replacementObjectForCoder, replacementObjectForKeyedArchiver, respondsToSelector, self, setAccessibilityActivationPoint, setAccessibilityAttributedHint, setAccessibilityAttributedLabel, setAccessibilityAttributedUserInputLabels, setAccessibilityAttributedValue, setAccessibilityContainerType, setAccessibilityCustomActions, setAccessibilityCustomRotors, setAccessibilityDragSourceDescriptors, setAccessibilityDropPointDescriptors, setAccessibilityElements, setAccessibilityElementsHidden, setAccessibilityFrame, setAccessibilityHint, setAccessibilityLabel, setAccessibilityLanguage, setAccessibilityNavigationStyle, setAccessibilityPath, setAccessibilityRespondsToUserInteraction, setAccessibilityTextualContext, setAccessibilityTraits, setAccessibilityUserInputLabels, setAccessibilityValue, setAccessibilityViewIsModal, setIsAccessibilityElement, setNilValueForKey, setObservationInfo, setShouldGroupAccessibilityChildren, setValueForKey, setValueForKeyPath, setValueForUndefinedKey, setValuesForKeysWithDictionary, shouldGroupAccessibilityChildren, superclass, validateValueForKeyError, validateValueForKeyPathError, valueForKey, valueForKeyPath, valueForUndefinedKey, willChangeValueForKey, willChangeValueForKeyWithSetMutationUsingObjects, willChangeValuesAtIndexesForKeypublic static boolean accessInstanceVariablesDirectly()
public static AVAudioPlayerNode alloc()
public static AVAudioPlayerNode allocWithZone(org.moe.natj.general.ptr.VoidPtr zone)
public static boolean automaticallyNotifiesObserversForKey(java.lang.String key)
public static void cancelPreviousPerformRequestsWithTarget(java.lang.Object aTarget)
public static void cancelPreviousPerformRequestsWithTargetSelectorObject(java.lang.Object aTarget,
org.moe.natj.objc.SEL aSelector,
java.lang.Object anArgument)
public static NSArray<java.lang.String> classFallbacksForKeyedArchiver()
public static org.moe.natj.objc.Class classForKeyedUnarchiver()
public static java.lang.String debugDescription_static()
public static java.lang.String description_static()
public AVAudioMixingDestination destinationForMixerBus(AVAudioNode mixer, long bus)
AVAudioMixingWhen a source node is connected to multiple mixers downstream, setting AVAudioMixing properties directly on the source node will apply the change to all the mixers downstream. If you want to set/get properties on a specific mixer, use this method to get the corresponding AVAudioMixingDestination and set/get properties on it.
Note: - Properties set on individual AVAudioMixingDestination instances will not reflect at the source node level.
- AVAudioMixingDestination reference returned by this method could become invalid when there is any disconnection between the source and the mixer node. Hence this reference should not be retained and should be fetched every time you want to set/get properties on a specific mixer.
If the source node is not connected to the specified mixer/input bus, this method returns nil.
Calling this on an AVAudioMixingDestination instance returns self if the specified mixer/input bus matches its connection point, otherwise, it returns nil.
destinationForMixerBus in interface AVAudioMixingpublic static long hash_static()
public AVAudioPlayerNode init()
init in class AVAudioNodepublic static NSObject.Function_instanceMethodForSelector_ret instanceMethodForSelector(org.moe.natj.objc.SEL aSelector)
public static NSMethodSignature instanceMethodSignatureForSelector(org.moe.natj.objc.SEL aSelector)
public static boolean instancesRespondToSelector(org.moe.natj.objc.SEL aSelector)
public boolean isPlaying()
Indicates whether or not the player is playing.
public static boolean isSubclassOfClass(org.moe.natj.objc.Class aClass)
public static NSSet<java.lang.String> keyPathsForValuesAffectingValueForKey(java.lang.String key)
public static AVAudioPlayerNode new_objc()
public AVAudioTime nodeTimeForPlayerTime(AVAudioTime playerTime)
Convert from player time to node time.
This method and its inverse `playerTimeForNodeTime:` are discussed in the introduction to this class.
If the player is not playing when this method is called, nil is returned.
playerTime - a time relative to the player's start timepublic float obstruction()
AVAudio3DMixingSimulates filtering of the direct path of sound due to an obstacle
Only the direct path of sound between the source and listener is blocked.
Range: -100.0 -> 0.0 dB Default: 0.0 Mixer: AVAudioEnvironmentNode
obstruction in interface AVAudio3DMixingpublic float occlusion()
AVAudio3DMixingSimulates filtering of the direct and reverb paths of sound due to an obstacle
Both the direct and reverb paths of sound between the source and listener are blocked.
Range: -100.0 -> 0.0 dB Default: 0.0 Mixer: AVAudioEnvironmentNode
occlusion in interface AVAudio3DMixingpublic float pan()
AVAudioStereoMixingSet a bus's stereo pan
Range: -1.0 -> 1.0 Default: 0.0 Mixer: AVAudioMixerNode
pan in interface AVAudioStereoMixingpublic void pause()
Pause playback.
The player's sample time does not advance while the node is paused.
Note that pausing or stopping all the players connected to an engine does not pause or stop the engine or the underlying hardware. The engine must be explicitly paused or stopped for the hardware to stop.
public void play()
Start or resume playback immediately.
equivalent to playAtTime:nil
public void playAtTime(AVAudioTime when)
Start or resume playback at a specific time.
This node is initially paused. Requests to play buffers or file segments are enqueued, and any necessary decoding begins immediately. Playback does not begin, however, until the player has started playing, via this method.
Note that providing an AVAudioTime which is past (before lastRenderTime) will cause the player to begin playback immediately.
E.g. To start a player X seconds in future:
// start engine and player
NSError *nsErr = nil;
[_engine startAndReturnError:&nsErr];
if (!nsErr) {
const float kStartDelayTime = 0.5; // sec
AVAudioFormat *outputFormat = [_player outputFormatForBus:0];
AVAudioFramePosition startSampleTime = _player.lastRenderTime.sampleTime + kStartDelayTime * outputFormat.sampleRate;
AVAudioTime *startTime = [AVAudioTime timeWithSampleTime:startSampleTime atRate:outputFormat.sampleRate];
[_player playAtTime:startTime];
}
when - the node time at which to start or resume playback. nil signifies "now".public AVAudioTime playerTimeForNodeTime(AVAudioTime nodeTime)
Convert from node time to player time.
This method and its inverse `nodeTimeForPlayerTime:` are discussed in the introduction to this class.
If the player is not playing when this method is called, nil is returned.
nodeTime - a node timepublic long pointSourceInHeadMode()
AVAudio3DMixingIn-head rendering choice for AVAudio3DMixingSourceModePointSource in AVAudio3DMixingRenderingAlgorithmAuto
Default: AVAudio3DMixingPointSourceInHeadModeMono Mixer: AVAudioEnvironmentNode
pointSourceInHeadMode in interface AVAudio3DMixingpublic AVAudio3DPoint position()
AVAudio3DMixingThe location of the source in the 3D environment
The coordinates are specified in meters.
Mixer: AVAudioEnvironmentNode
position in interface AVAudio3DMixingpublic void prepareWithFrameCount(int frameCount)
Prepares previously scheduled file regions or buffers for playback.
frameCount - The number of sample frames of data to be prepared before returning.public float rate()
AVAudio3DMixingChanges the playback rate of the input signal
A value of 2.0 results in the output audio playing one octave higher. A value of 0.5, results in the output audio playing one octave lower.
Range: 0.5 -> 2.0 Default: 1.0 Mixer: AVAudioEnvironmentNode
rate in interface AVAudio3DMixingpublic long renderingAlgorithm()
AVAudio3DMixingType of rendering algorithm used
Depending on the current output format of the AVAudioEnvironmentNode, only a subset of the rendering algorithms may be supported. An array of valid rendering algorithms can be retrieved by calling applicableRenderingAlgorithms on AVAudioEnvironmentNode.
Default: AVAudio3DMixingRenderingAlgorithmEqualPowerPanning Mixer: AVAudioEnvironmentNode
renderingAlgorithm in interface AVAudio3DMixingpublic static boolean resolveClassMethod(org.moe.natj.objc.SEL sel)
public static boolean resolveInstanceMethod(org.moe.natj.objc.SEL sel)
public float reverbBlend()
AVAudio3DMixingControls the blend of dry and reverb processed audio
This property controls the amount of the source's audio that will be processed by the reverb in AVAudioEnvironmentNode. A value of 0.5 will result in an equal blend of dry and processed (wet) audio.
Range: 0.0 (completely dry) -> 1.0 (completely wet) Default: 0.0 Mixer: AVAudioEnvironmentNode
reverbBlend in interface AVAudio3DMixingpublic void scheduleBufferAtTimeOptionsCompletionCallbackTypeCompletionHandler(AVAudioPCMBuffer buffer, AVAudioTime when, long options, long callbackType, AVAudioPlayerNode.Block_scheduleBufferAtTimeOptionsCompletionCallbackTypeCompletionHandler completionHandler)
Schedule playing samples from an AVAudioBuffer.
buffer - the buffer to playwhen - the time at which to play the buffer. see the discussion of timestamps, above.options - options for looping, interrupting other buffers, etc.callbackType - option to specify when the completion handler must be calledcompletionHandler - called after the buffer has been consumed by the player or has finished playing back or
the player is stopped. may be nil.public void scheduleBufferAtTimeOptionsCompletionHandler(AVAudioPCMBuffer buffer, AVAudioTime when, long options, AVAudioPlayerNode.Block_scheduleBufferAtTimeOptionsCompletionHandler completionHandler)
Schedule playing samples from an AVAudioBuffer.
It is possible for the completionHandler to be called before rendering begins or before the buffer is played completely.
buffer - the buffer to playwhen - the time at which to play the buffer. see the discussion of timestamps, above.options - options for looping, interrupting other buffers, etc.completionHandler - called after the buffer has been consumed by the player or the player is stopped. may be nil.public void scheduleBufferCompletionCallbackTypeCompletionHandler(AVAudioPCMBuffer buffer, long callbackType, AVAudioPlayerNode.Block_scheduleBufferCompletionCallbackTypeCompletionHandler completionHandler)
Schedule playing samples from an AVAudioBuffer.
Schedules the buffer to be played following any previously scheduled commands.
buffer - the buffer to playcallbackType - option to specify when the completion handler must be calledcompletionHandler - called after the buffer has been consumed by the player or has finished playing back or
the player is stopped. may be nil.public void scheduleBufferCompletionHandler(AVAudioPCMBuffer buffer, AVAudioPlayerNode.Block_scheduleBufferCompletionHandler completionHandler)
Schedule playing samples from an AVAudioBuffer.
Schedules the buffer to be played following any previously scheduled commands.
It is possible for the completionHandler to be called before rendering begins or before the buffer is played completely.
buffer - the buffer to playcompletionHandler - called after the buffer has been consumed by the player or the player is stopped. may be nil.public void scheduleFileAtTimeCompletionCallbackTypeCompletionHandler(AVAudioFile file, AVAudioTime when, long callbackType, AVAudioPlayerNode.Block_scheduleFileAtTimeCompletionCallbackTypeCompletionHandler completionHandler)
Schedule playing of an entire audio file.
file - the file to playwhen - the time at which to play the file. see the discussion of timestamps, above.callbackType - option to specify when the completion handler must be calledcompletionHandler - called after the file has been consumed by the player or has finished playing back or
the player is stopped. may be nil.public void scheduleFileAtTimeCompletionHandler(AVAudioFile file, AVAudioTime when, AVAudioPlayerNode.Block_scheduleFileAtTimeCompletionHandler completionHandler)
Schedule playing of an entire audio file.
It is possible for the completionHandler to be called before rendering begins or before the file is played completely.
file - the file to playwhen - the time at which to play the file. see the discussion of timestamps, above.completionHandler - called after the file has been consumed by the player or the player is stopped. may be nil.public void scheduleSegmentStartingFrameFrameCountAtTimeCompletionCallbackTypeCompletionHandler(AVAudioFile file, long startFrame, int numberFrames, AVAudioTime when, long callbackType, AVAudioPlayerNode.Block_scheduleSegmentStartingFrameFrameCountAtTimeCompletionCallbackTypeCompletionHandler completionHandler)
Schedule playing a segment of an audio file.
file - the file to playstartFrame - the starting frame position in the streamnumberFrames - the number of frames to playwhen - the time at which to play the region. see the discussion of timestamps, above.callbackType - option to specify when the completion handler must be calledcompletionHandler - called after the segment has been consumed by the player or has finished playing back or
the player is stopped. may be nil.public void scheduleSegmentStartingFrameFrameCountAtTimeCompletionHandler(AVAudioFile file, long startFrame, int numberFrames, AVAudioTime when, AVAudioPlayerNode.Block_scheduleSegmentStartingFrameFrameCountAtTimeCompletionHandler completionHandler)
Schedule playing a segment of an audio file.
It is possible for the completionHandler to be called before rendering begins or before the segment is played completely.
file - the file to playstartFrame - the starting frame position in the streamnumberFrames - the number of frames to playwhen - the time at which to play the region. see the discussion of timestamps, above.completionHandler - called after the segment has been consumed by the player or the player is stopped. may be nil.public void setObstruction(float value)
AVAudio3DMixingSimulates filtering of the direct path of sound due to an obstacle
Only the direct path of sound between the source and listener is blocked.
Range: -100.0 -> 0.0 dB Default: 0.0 Mixer: AVAudioEnvironmentNode
setObstruction in interface AVAudio3DMixingpublic void setOcclusion(float value)
AVAudio3DMixingSimulates filtering of the direct and reverb paths of sound due to an obstacle
Both the direct and reverb paths of sound between the source and listener are blocked.
Range: -100.0 -> 0.0 dB Default: 0.0 Mixer: AVAudioEnvironmentNode
setOcclusion in interface AVAudio3DMixingpublic void setPan(float value)
AVAudioStereoMixingSet a bus's stereo pan
Range: -1.0 -> 1.0 Default: 0.0 Mixer: AVAudioMixerNode
setPan in interface AVAudioStereoMixingpublic void setPointSourceInHeadMode(long value)
AVAudio3DMixingIn-head rendering choice for AVAudio3DMixingSourceModePointSource in AVAudio3DMixingRenderingAlgorithmAuto
Default: AVAudio3DMixingPointSourceInHeadModeMono Mixer: AVAudioEnvironmentNode
setPointSourceInHeadMode in interface AVAudio3DMixingpublic void setPosition(AVAudio3DPoint value)
AVAudio3DMixingThe location of the source in the 3D environment
The coordinates are specified in meters.
Mixer: AVAudioEnvironmentNode
setPosition in interface AVAudio3DMixingpublic void setRate(float value)
AVAudio3DMixingChanges the playback rate of the input signal
A value of 2.0 results in the output audio playing one octave higher. A value of 0.5, results in the output audio playing one octave lower.
Range: 0.5 -> 2.0 Default: 1.0 Mixer: AVAudioEnvironmentNode
setRate in interface AVAudio3DMixingpublic void setRenderingAlgorithm(long value)
AVAudio3DMixingType of rendering algorithm used
Depending on the current output format of the AVAudioEnvironmentNode, only a subset of the rendering algorithms may be supported. An array of valid rendering algorithms can be retrieved by calling applicableRenderingAlgorithms on AVAudioEnvironmentNode.
Default: AVAudio3DMixingRenderingAlgorithmEqualPowerPanning Mixer: AVAudioEnvironmentNode
setRenderingAlgorithm in interface AVAudio3DMixingpublic void setReverbBlend(float value)
AVAudio3DMixingControls the blend of dry and reverb processed audio
This property controls the amount of the source's audio that will be processed by the reverb in AVAudioEnvironmentNode. A value of 0.5 will result in an equal blend of dry and processed (wet) audio.
Range: 0.0 (completely dry) -> 1.0 (completely wet) Default: 0.0 Mixer: AVAudioEnvironmentNode
setReverbBlend in interface AVAudio3DMixingpublic void setSourceMode(long value)
AVAudio3DMixingControls how individual channels of an input bus are rendered
Default: AVAudio3DMixingSourceModeSpatializeIfMono Mixer: AVAudioEnvironmentNode
setSourceMode in interface AVAudio3DMixingpublic static void setVersion_static(long aVersion)
public void setVolume(float value)
AVAudioMixingSet a bus's input volume
Range: 0.0 -> 1.0 Default: 1.0 Mixers: AVAudioMixerNode, AVAudioEnvironmentNode
setVolume in interface AVAudioMixingpublic long sourceMode()
AVAudio3DMixingControls how individual channels of an input bus are rendered
Default: AVAudio3DMixingSourceModeSpatializeIfMono Mixer: AVAudioEnvironmentNode
sourceMode in interface AVAudio3DMixingpublic void stop()
Clear all of the node's previously scheduled events and stop playback.
All of the node's previously scheduled events are cleared, including any that are in the middle of playing. The node's sample time (and therefore the times to which new events are to be scheduled) is reset to 0, and will not proceed until the node is started again (via play or playAtTime).
Note that pausing or stopping all the players connected to an engine does not pause or stop the engine or the underlying hardware. The engine must be explicitly paused or stopped for the hardware to stop.
public static org.moe.natj.objc.Class superclass_static()
public static long version_static()
public float volume()
AVAudioMixingSet a bus's input volume
Range: 0.0 -> 1.0 Default: 1.0 Mixers: AVAudioMixerNode, AVAudioEnvironmentNode
volume in interface AVAudioMixing