AudioEngineFFI constructor
AudioEngineFFI({
- String? libraryPath,
Implementation
AudioEngineFFI({String? libraryPath})
: _lib = _openLibrary(libraryPath),
_engine = ffi.nullptr {
final allocLib = _openAllocatorLibrary();
_malloc = allocLib.lookupFunction<_MallocNative, _MallocDart>('malloc');
_free = allocLib.lookupFunction<_FreeNative, _FreeDart>('free');
_createEngine = _lib.lookupFunction<_CreateEngineNative, _CreateEngineDart>(
'ae_create_engine',
);
_destroyEngine =
_lib.lookupFunction<_DestroyEngineNative, _DestroyEngineDart>(
'ae_destroy_engine',
);
_setPlaylist = _lib.lookupFunction<_SetPlaylistNative, _SetPlaylistDart>(
'ae_set_playlist',
);
_addToPlaylist =
_lib.lookupFunction<_AddToPlaylistNative, _AddToPlaylistDart>(
'ae_add_to_playlist',
);
_insertToPlaylist =
_lib.lookupFunction<_InsertToPlaylistNative, _InsertToPlaylistDart>(
'ae_insert_to_playlist',
);
_removeFromPlaylist =
_lib.lookupFunction<_RemoveFromPlaylistNative, _RemoveFromPlaylistDart>(
'ae_remove_from_playlist',
);
_movePlaylistItem =
_lib.lookupFunction<_MovePlaylistItemNative, _MovePlaylistItemDart>(
'ae_move_playlist_item',
);
_clearPlaylist =
_lib.lookupFunction<_ClearPlaylistNative, _ClearPlaylistDart>(
'ae_clear_playlist',
);
_play = _lib.lookupFunction<_BoolOpNative, _BoolOpDart>('ae_play');
_pause = _lib.lookupFunction<_BoolOpNative, _BoolOpDart>('ae_pause');
_stop = _lib.lookupFunction<_BoolOpNative, _BoolOpDart>('ae_stop');
_next = _lib.lookupFunction<_BoolOpNative, _BoolOpDart>('ae_next');
_prev = _lib.lookupFunction<_BoolOpNative, _BoolOpDart>('ae_prev');
_seek = _lib.lookupFunction<_SeekNative, _SeekDart>('ae_seek');
_jumpTo = _lib.lookupFunction<_JumpNative, _JumpDart>('ae_jump_to');
_jumpToWithPosition =
_lib.lookupFunction<_JumpWithPositionNative, _JumpWithPositionDart>(
'ae_jump_to_with_position',
);
_getStatus = _lib.lookupFunction<_GetStatusNative, _GetStatusDart>(
'ae_get_status',
);
_getLastError = _lib.lookupFunction<_GetLastErrorNative, _GetLastErrorDart>(
'ae_get_last_error',
);
_clearLastError =
_lib.lookupFunction<_ClearLastErrorNative, _ClearLastErrorDart>(
'ae_clear_last_error',
);
_setLoopMode = _lib.lookupFunction<_SetIntNative, _SetIntDart>(
'ae_set_loop_mode',
);
_setShuffleEnabled = _lib.lookupFunction<_SetIntNative, _SetIntDart>(
'ae_set_shuffle_enabled',
);
_reshuffle = _lib.lookupFunction<_ClearPlaylistNative, _ClearPlaylistDart>(
'ae_reshuffle',
);
_setCrossfadeEnabled = _lib.lookupFunction<_SetIntNative, _SetIntDart>(
'ae_set_crossfade_enabled',
);
_getCrossfadeEnabled = _lib.lookupFunction<_GetIntNative, _GetIntDart>(
'ae_get_crossfade_enabled',
);
_setCrossfadeDurationMs = _lib.lookupFunction<_SetIntNative, _SetIntDart>(
'ae_set_crossfade_duration_ms',
);
_getCrossfadeDurationMs = _lib.lookupFunction<_GetIntNative, _GetIntDart>(
'ae_get_crossfade_duration_ms',
);
_setReverbEnabled =
_lib.lookupFunction<_SetFxEnabledNative, _SetFxEnabledDart>(
'ae_set_reverb_enabled',
);
_setReverbParams =
_lib.lookupFunction<_SetReverbParamsNative, _SetReverbParamsDart>(
'ae_set_reverb_params',
);
_setEqEnabled = _lib.lookupFunction<_SetFxEnabledNative, _SetFxEnabledDart>(
'ae_set_eq_enabled',
);
_setEqGains = _lib.lookupFunction<_SetEqGainsNative, _SetEqGainsDart>(
'ae_set_eq_gains',
);
_setGain = _lib.lookupFunction<_SetSingleFloatNative, _SetSingleFloatDart>(
'ae_set_gain',
);
_setPan = _lib.lookupFunction<_SetSingleFloatNative, _SetSingleFloatDart>(
'ae_set_pan',
);
_setLowpassEnabled =
_lib.lookupFunction<_SetFxEnabledNative, _SetFxEnabledDart>(
'ae_set_lowpass_enabled',
);
_setLowpassCutoff =
_lib.lookupFunction<_SetSingleFloatNative, _SetSingleFloatDart>(
'ae_set_lowpass_cutoff',
);
_setHighpassEnabled =
_lib.lookupFunction<_SetFxEnabledNative, _SetFxEnabledDart>(
'ae_set_highpass_enabled',
);
_setHighpassCutoff =
_lib.lookupFunction<_SetSingleFloatNative, _SetSingleFloatDart>(
'ae_set_highpass_cutoff',
);
_setDelayEnabled =
_lib.lookupFunction<_SetFxEnabledNative, _SetFxEnabledDart>(
'ae_set_delay_enabled',
);
_setDelayParams =
_lib.lookupFunction<_SetReverbParamsNative, _SetReverbParamsDart>(
'ae_set_delay_params',
);
_setBandpassEnabled =
_lib.lookupFunction<_SetFxEnabledNative, _SetFxEnabledDart>(
'ae_set_bandpass_enabled',
);
_setBandpassParams =
_lib.lookupFunction<_SetTwoFloatsNative, _SetTwoFloatsDart>(
'ae_set_bandpass_params',
);
_setPeakEqEnabled =
_lib.lookupFunction<_SetFxEnabledNative, _SetFxEnabledDart>(
'ae_set_peak_eq_enabled',
);
_setPeakEqParams =
_lib.lookupFunction<_SetReverbParamsNative, _SetReverbParamsDart>(
'ae_set_peak_eq_params',
);
_setNotchEnabled =
_lib.lookupFunction<_SetFxEnabledNative, _SetFxEnabledDart>(
'ae_set_notch_enabled',
);
_setNotchParams =
_lib.lookupFunction<_SetTwoFloatsNative, _SetTwoFloatsDart>(
'ae_set_notch_params',
);
_setLowshelfEnabled =
_lib.lookupFunction<_SetFxEnabledNative, _SetFxEnabledDart>(
'ae_set_lowshelf_enabled',
);
_setLowshelfParams =
_lib.lookupFunction<_SetReverbParamsNative, _SetReverbParamsDart>(
'ae_set_lowshelf_params',
);
_setHighshelfEnabled =
_lib.lookupFunction<_SetFxEnabledNative, _SetFxEnabledDart>(
'ae_set_highshelf_enabled',
);
_setHighshelfParams =
_lib.lookupFunction<_SetReverbParamsNative, _SetReverbParamsDart>(
'ae_set_highshelf_params',
);
// Advanced Audio Features Bindings
_setOutputFormat =
_lib.lookupFunction<_SetOutputFormatNative, _SetOutputFormatDart>(
'ae_set_output_format',
);
_getOutputFormat =
_lib.lookupFunction<_GetOutputFormatNative, _GetOutputFormatDart>(
'ae_get_output_format',
);
_setOutputSampleRate =
_lib.lookupFunction<_SetOutputRateNative, _SetOutputRateDart>(
'ae_set_output_sample_rate',
);
_getOutputSampleRate =
_lib.lookupFunction<_GetOutputRateNative, _GetOutputRateDart>(
'ae_get_output_sample_rate',
);
_setOutputChannels =
_lib.lookupFunction<_SetOutputChannelsNative, _SetOutputChannelsDart>(
'ae_set_output_channels',
);
_getOutputChannels =
_lib.lookupFunction<_GetOutputChannelsNative, _GetOutputChannelsDart>(
'ae_get_output_channels',
);
_initMultibandEq =
_lib.lookupFunction<_InitMultibandEqNative, _InitMultibandEqDart>(
'ae_init_multiband_eq',
);
_setMultibandEqEnabled = _lib.lookupFunction<_SetMultibandEqEnabledNative,
_SetMultibandEqEnabledDart>('ae_set_multiband_eq_enabled');
_setMultibandEqGain =
_lib.lookupFunction<_SetMultibandEqGainNative, _SetMultibandEqGainDart>(
'ae_set_multiband_eq_gain',
);
_getMultibandEqGain =
_lib.lookupFunction<_GetMultibandEqGainNative, _GetMultibandEqGainDart>(
'ae_get_multiband_eq_gain',
);
_setMultibandFxEnabled = _lib.lookupFunction<_SetMultibandFxEnabledNative,
_SetMultibandFxEnabledDart>('ae_set_multiband_fx_enabled');
_setMultibandFxBands = _lib
.lookupFunction<_SetMultibandFxBandsNative, _SetMultibandFxBandsDart>(
'ae_set_multiband_fx_bands',
);
_clearMultibandFx =
_lib.lookupFunction<_ClearMultibandFxNative, _ClearMultibandFxDart>(
'ae_clear_multiband_fx',
);
_initPushStream =
_lib.lookupFunction<_InitPushStreamNative, _InitPushStreamDart>(
'ae_init_push_stream',
);
_pushStreamChunk =
_lib.lookupFunction<_PushStreamChunkNative, _PushStreamChunkDart>(
'ae_push_stream_chunk',
);
_endPushStream =
_lib.lookupFunction<_EndPushStreamNative, _EndPushStreamDart>(
'ae_end_push_stream',
);
_getPushStreamBufferedBytes = _lib.lookupFunction<
_GetPushStreamBufferedBytesNative, _GetPushStreamBufferedBytesDart>(
'ae_get_push_stream_buffered_bytes',
);
_setAnalyzerEnabled =
_lib.lookupFunction<_SetAnalyzerEnabledNative, _SetAnalyzerEnabledDart>(
'ae_set_analyzer_enabled',
);
_configureAnalyzer =
_lib.lookupFunction<_ConfigureAnalyzerNative, _ConfigureAnalyzerDart>(
'ae_configure_analyzer',
);
_getAnalyzerFrameSize = _lib.lookupFunction<_GetAnalyzerFrameSizeNative,
_GetAnalyzerFrameSizeDart>('ae_get_analyzer_frame_size');
_pollAnalyzerFrame =
_lib.lookupFunction<_PollAnalyzerFrameNative, _PollAnalyzerFrameDart>(
'ae_poll_analyzer_frame',
);
_getAnalyzerDroppedFrames = _lib.lookupFunction<
_GetAnalyzerDroppedFramesNative,
_GetAnalyzerDroppedFramesDart>('ae_get_analyzer_dropped_frames');
try {
_getNetworkStreamingSupport = _lib.lookupFunction<
_GetNetworkStreamingSupportNative,
_GetNetworkStreamingSupportDart>('ae_is_network_streaming_supported');
} catch (_) {
_getNetworkStreamingSupport = null;
}
}