### start method Source: https://pub.dev/documentation/record/latest/record/AudioRecorder/start.html Starts a new recording session. The output path can be retrieved when the stop method is called. ```APIDOC ## start method ### Description Starts a new recording session. The output path can be retrieved when the stop method is called. ### Method Signature Future start(RecordConfig config, {required String path}) ### Parameters #### Path Parameters - **config** (RecordConfig) - Required - The recording configuration. - **path** (String) - Required - The output path file. Required on all IO platforms. On `web`: This parameter is ignored. ``` -------------------------------- ### Install Linux Audio Dependencies Source: https://pub.dev/documentation/record/latest/index.html Install required audio utilities (`parecord`, `pactl`, `ffmpeg`) on Ubuntu using apt. ```bash sudo apt install pulseaudio-utils ffmpeg ``` -------------------------------- ### start(String recorderId, RecordConfig config, {required String path}) Source: https://pub.dev/documentation/record/latest/record/RecordPlatform-class.html Starts a new recording session for the specified recorder, saving the output to the given path with the provided configuration. ```APIDOC ## start(String recorderId, RecordConfig config, {required String path}) ### Description Starts new recording session. ### Method `start` ### Parameters #### Path Parameters - **recorderId** (String) - Required - The unique identifier for the recorder. - **config** (RecordConfig) - Required - The configuration for the recording session. - **path** (String) - Required - The file path where the recording will be saved. ``` -------------------------------- ### start abstract method Source: https://pub.dev/documentation/record/latest/record/RecordMethodChannelPlatformInterface/start.html Starts a new recording session. The output path can be retrieved when the stop method is called. ```APIDOC ## start abstract method ### Description Starts a new recording session. The output path can be retrieved when the stop method is called. ### Method Future ### Parameters #### Path Parameters - **recorderId** (String) - Required - The identifier for the recorder. - **config** (RecordConfig) - Required - The configuration for the recording. #### Query Parameters - **path** (String) - Required - The output path file. Required on all IO platforms. On `web`: This parameter is ignored. ``` -------------------------------- ### AudioRecorder Constructor Source: https://pub.dev/documentation/record/latest/record/AudioRecorder/AudioRecorder.html Creates a new audio recorder instance. This is the primary way to get started with recording audio. ```APIDOC ## AudioRecorder() ### Description Creates a new audio recorder. ### Method Constructor ### Endpoint N/A (Class Constructor) ### Parameters None ### Request Example ```dart final recorder = AudioRecorder(); ``` ### Response #### Success Response - **AudioRecorder** (object) - A new instance of the AudioRecorder. #### Response Example ```dart // No direct response object to show, instantiation is implicit. ``` ``` -------------------------------- ### start() Source: https://pub.dev/documentation/record/latest/record/AudioRecorder-class.html Initiates a new audio recording session with the specified configuration and saves it to the given path. ```APIDOC start(RecordConfig config, {required String path}) → Future Starts new recording session. ``` -------------------------------- ### Record Audio to File or Stream Source: https://pub.dev/documentation/record/latest/index.html Demonstrates how to initialize the recorder, check permissions, start recording to a file or stream, stop/cancel recording, and dispose of the recorder instance. Ensure to handle permissions before starting. ```dart import 'package:record/record.dart'; final record = AudioRecorder(); // Check and request permission if needed if (await record.hasPermission()) { // Start recording to file await record.start(const RecordConfig(), path: 'aFullPath/myFile.m4a'); // ... or to stream final stream = await record.startStream(const RecordConfig(encoder: AudioEncoder.pcm16bits)); } // Stop recording... final path = await record.stop(); // ... or cancel it (and implicitly remove file/blob). await record.cancel(); record.dispose(); // As always, don't forget this one. ``` -------------------------------- ### Start Audio Recording Source: https://pub.dev/documentation/record/latest/record/AudioRecorder/start.html Starts a new recording session with the provided configuration and output path. The path is required for IO platforms but ignored on the web. The output path can be retrieved later using the stop method. ```dart Future start(RecordConfig config, {required String path}) async { _initStateStream(); await _safeCall(() => _platform.start(_recorderId, config, path: path)); } ``` -------------------------------- ### Start Abstract Method Signature Source: https://pub.dev/documentation/record/latest/record/RecordMethodChannelPlatformInterface/start.html This is the abstract method signature for starting a new recording session. It defines the parameters required for initiating recording. ```dart Future start(String recorderId, RecordConfig config, {required String path}); ``` -------------------------------- ### startStream Source: https://pub.dev/documentation/record/latest/record/RecordMethodChannelPlatformInterface/startStream.html Starts recording audio and returns a stream of Uint8List. The stream will contain the recorded audio data. When stopping the record, you must rely on the stream's close event to get the full recorded data. ```APIDOC ## startStream ### Description Starts recording audio and returns a stream of `Uint8List`. The stream will contain the recorded audio data. When stopping the record, you must rely on the stream's close event to get the full recorded data. ### Method Signature `Future> startStream(String recorderId, RecordConfig config)` ### Parameters #### Path Parameters - **recorderId** (String) - Required - The identifier for the recorder. - **config** (RecordConfig) - Required - The configuration for the recording. ### Returns - **Future>** - A future that resolves to a stream of `Uint8List` containing the recorded audio data. ``` -------------------------------- ### startStream method Source: https://pub.dev/documentation/record/latest/record/AudioRecorder/startStream.html Starts stream recording and returns the stream. When stopping the record, you must rely on stream close event to get full recorded data. ```APIDOC ## startStream method ### Description Starts stream recording and returns the stream. When stopping the record, you must rely on stream close event to get full recorded data. ### Method Signature Future> startStream(RecordConfig config) ### Parameters #### Path Parameters - **config** (RecordConfig) - Required - Configuration for the recording. ### Response #### Success Response - Returns a `Future>` which provides the recorded audio data as a stream of bytes. ``` -------------------------------- ### startStream Source: https://pub.dev/documentation/record/latest/record/RecordMethodChannelPlatformInterface-class.html Starts a new recording session for the specified recorder, outputting the recording as a stream of bytes. ```APIDOC ## startStream(String recorderId, RecordConfig config) ### Description Same as start with output stream instead of a path. ### Method N/A (Method call) ### Parameters #### Path Parameters - **recorderId** (String) - Required - The unique identifier for the recorder. - **config** (RecordConfig) - Required - The configuration for the recording session. ### Response #### Success Response - **Stream** - A stream of byte data representing the recording. ``` -------------------------------- ### Start Audio Stream Recording Source: https://pub.dev/documentation/record/latest/record/AudioRecorder/startStream.html Starts the audio recording stream using the provided RecordConfig. Ensure to handle the stream's close event for complete data retrieval. This method internally calls _initStateStream, _stopRecordStream, and _startRecordStream. ```dart Future> startStream(RecordConfig config) { _initStateStream(); return _safeCall(() async { await _stopRecordStream(); final stream = await _platform.startStream(_recorderId, config); return _startRecordStream(stream); }); } ``` -------------------------------- ### startStream(String recorderId, RecordConfig config) Source: https://pub.dev/documentation/record/latest/record/RecordPlatform-class.html Starts a new recording session for the specified recorder, returning an output stream of audio data instead of saving to a file. ```APIDOC ## startStream(String recorderId, RecordConfig config) ### Description Same as start with output stream instead of a path. ### Method `startStream` ### Parameters #### Path Parameters - **recorderId** (String) - Required - The unique identifier for the recorder. - **config** (RecordConfig) - Required - The configuration for the recording session. ### Response #### Success Response (Stream) - **Stream** - A stream emitting chunks of recorded audio data as Uint8List. ``` -------------------------------- ### startStream Abstract Method Signature Source: https://pub.dev/documentation/record/latest/record/RecordMethodChannelPlatformInterface/startStream.html This is the abstract method signature for starting a stream of recorded data. It takes a recorder ID and a configuration object. The stream should be closed to ensure all recorded data is retrieved. ```dart Future> startStream(String recorderId, RecordConfig config); ``` -------------------------------- ### getAmplitude method Source: https://pub.dev/documentation/record/latest/record/AudioRecorder/getAmplitude.html Gets current average & max amplitudes (dBFS). Always returns zeros on unsupported platforms. ```APIDOC ## getAmplitude ### Description Gets current average & max amplitudes (dBFS). Always returns zeros on unsupported platforms. ### Signature Future getAmplitude() ### Implementation ```dart Future getAmplitude() { return _safeCall(() => _platform.getAmplitude(_recorderId)); } ``` ``` -------------------------------- ### get ios Source: https://pub.dev/documentation/record/latest/record/AudioRecorder/ios.html Retrieves the iOS-specific recorder interface. Returns null if the application is not running on an iOS platform. ```APIDOC ## get ios ### Description Retrieves the iOS-specific recorder interface. Returns `null` when not on the iOS platform. ### Method ```dart RecordIos? get ios ``` ### Returns - `RecordIos?`: An instance of `RecordIos` if on iOS, otherwise `null`. ``` -------------------------------- ### manageAudioSession Source: https://pub.dev/documentation/record/latest/record/RecordIos/manageAudioSession.html Activates or deactivates the management of the iOS audio session. When set to true, the plugin handles audio session activation and category setup. When false, the audio session remains unchanged by the plugin, though other recording-related parameters might be adjusted. ```APIDOC ## manageAudioSession ### Description Activates or deactivates the management of iOS audio session. If `true`, the plugin will activate session and setup categories for you. This may conflict with current settings in your app if you already have external audio session management. If `false`, the audio session won't be activated and categories will stay the same. Other parameters may be touched for recording requirements (interruption, sample rate, channels, ...). In both cases, usage of setAudioSessionActive and setAudioSessionCategory is allowed. ### Method Future ### Parameters #### Path Parameters - **manage** (bool) - Required - Controls whether the plugin manages the audio session. `true` for activation and setup, `false` to leave it unchanged. ### Request Example ```dart // Example of activating audio session management await record.manageAudioSession(true); // Example of deactivating audio session management await record.manageAudioSession(false); ``` ### Response #### Success Response (void) This method does not return a value upon successful execution. #### Response Example ```json // No response body for void return type ``` ``` -------------------------------- ### Get iOS Recorder Properties Source: https://pub.dev/documentation/record/latest/record/AudioRecorder/ios.html Retrieves the iOS-specific recorder implementation. Returns null if the current platform is not iOS. ```dart RecordIos? get ios { final inner = _platform.getIos(_recorderId); if (inner == null) return null; return _RecordIosSafeWrapper(inner, _safeCall); } ``` -------------------------------- ### startStream() Source: https://pub.dev/documentation/record/latest/record/AudioRecorder-class.html Begins streaming audio data with the given configuration and returns a stream of recorded bytes. ```APIDOC startStream(RecordConfig config) → Future> Starts stream recording and returns the stream. ``` -------------------------------- ### InputDevice.fromMap Source: https://pub.dev/documentation/record/latest/record/InputDevice/InputDevice.fromMap.html Creates an InputDevice instance from a Map. The map should contain keys like 'id', 'label', 'type', and 'sampleRates'. ```APIDOC ## InputDevice.fromMap factory constructor ### Description Creates an InputDevice instance from a Map. ### Parameters #### Path Parameters - **map** (Map) - Required - The map containing the input device data. ### Implementation ```dart factory InputDevice.fromMap(Map map) => InputDevice( id: map['id'], label: map['label'], type: InputDeviceType.fromString(map['type'] as String?), sampleRates: List.from(map['sampleRates'] as List? ?? const []), ); ``` ``` -------------------------------- ### IosRecordConfig Constructor Source: https://pub.dev/documentation/record/latest/record/IosRecordConfig-class.html Initializes an IosRecordConfig object with optional category options and haptics/system sounds setting. ```APIDOC ## Constructor ### IosRecordConfig Initializes an `IosRecordConfig` object. #### Parameters - **categoryOptions** (`List`): Constants that specify optional audio behaviors. Defaults to `[IosAudioCategoryOption.defaultToSpeaker, IosAudioCategoryOption.allowBluetooth, IosAudioCategoryOption.allowBluetoothA2DP]`. - **allowHapticsAndSystemSoundsDuringRecording** (`bool`): Whether haptics and system sounds are allowed to play while recording. Defaults to `false`. ``` -------------------------------- ### RecordEventChannelPlatformInterface Constructor Source: https://pub.dev/documentation/record/latest/record/RecordEventChannelPlatformInterface/RecordEventChannelPlatformInterface.html Initializes a new instance of the RecordEventChannelPlatformInterface. ```APIDOC ## RecordEventChannelPlatformInterface() ### Description Initializes a new instance of the RecordEventChannelPlatformInterface. ### Method constructor ### Endpoint N/A ### Parameters None ### Request Example ``` RecordEventChannelPlatformInterface() ``` ### Response #### Success Response Initializes an object of type RecordEventChannelPlatformInterface. ### Response Example ``` { "instance": "RecordEventChannelPlatformInterface" } ``` ``` -------------------------------- ### getIos abstract method Source: https://pub.dev/documentation/record/latest/record/RecordMethodChannelPlatformInterface/getIos.html Abstract method to retrieve iOS-specific recording information. Returns null if the platform is not iOS. ```APIDOC ## getIos ### Description Retrieves iOS-specific recording information for a given recorder ID. This method is intended for iOS platform implementations and will return `null` when executed on other platforms. ### Method Abstract method signature ### Parameters #### Path Parameters - **recorderId** (String) - Required - The unique identifier of the recorder. ### Response #### Success Response - **RecordIos?** - An object containing iOS-specific recording details, or `null` if the platform is not iOS. ``` -------------------------------- ### AudioRecorder() Source: https://pub.dev/documentation/record/latest/record/AudioRecorder-class.html Creates a new instance of the AudioRecorder. ```APIDOC ## Constructors AudioRecorder() Creates a new audio recorder. ``` -------------------------------- ### Get Amplitude - AudioRecorder Source: https://pub.dev/documentation/record/latest/record/AudioRecorder/getAmplitude.html Retrieves the current average and maximum amplitudes (dBFS). Returns zeros on unsupported platforms. ```dart Future getAmplitude() { return _safeCall(() => _platform.getAmplitude(_recorderId)); } ``` -------------------------------- ### Create Method Implementation Source: https://pub.dev/documentation/record/latest/record/RecordMethodChannelPlatformInterface/create.html This is the concrete implementation signature for the create method, matching the abstract signature. ```dart Future create(String recorderId); ``` -------------------------------- ### getAmplitude(String recorderId) Source: https://pub.dev/documentation/record/latest/record/RecordPlatform-class.html Gets the current average and maximum amplitudes (dBFS) for the specified recorder. Returns zeros on unsupported platforms. ```APIDOC ## getAmplitude(String recorderId) ### Description Gets current average & max amplitudes (dBFS) Always returns zeros on unsupported platforms ### Method `getAmplitude` ### Parameters #### Path Parameters - **recorderId** (String) - Required - The unique identifier for the recorder. ### Response #### Success Response (Amplitude) - **Amplitude** - The current average and maximum amplitudes. ``` -------------------------------- ### RecordConfig.fromMap Factory Constructor Implementation Source: https://pub.dev/documentation/record/latest/record/RecordConfig/RecordConfig.fromMap.html This snippet shows the implementation of the RecordConfig.fromMap factory constructor. It parses a Map to create a RecordConfig object, handling default values for various audio recording parameters like encoder, bit rate, sample rate, and channel count. It also supports nested map parsing for device configuration and enum parsing for audio interruption modes. ```dart factory RecordConfig.fromMap(Map map) { return RecordConfig( encoder: AudioEncoder.values.firstWhere( (e) => e.name == map['encoder'], orElse: () => AudioEncoder.aacLc, ), bitRate: map['bitRate'] as int? ?? 128000, sampleRate: map['sampleRate'] as int? ?? 44100, numChannels: map['numChannels'] as int? ?? 2, device: map['device'] != null ? InputDevice.fromMap(map['device'] as Map) : null, autoGain: map['autoGain'] as bool? ?? false, echoCancel: map['echoCancel'] as bool? ?? false, noiseSuppress: map['noiseSuppress'] as bool? ?? false, audioInterruption: AudioInterruptionMode.values[map['audioInterruption'] as int? ?? AudioInterruptionMode.pause.index], streamBufferSize: map['streamBufferSize'] as int?, ); } ``` -------------------------------- ### RecordConfig.fromMap Source: https://pub.dev/documentation/record/latest/record/RecordConfig/RecordConfig.fromMap.html Creates a RecordConfig instance from a Map. This is a factory constructor that parses a map to configure audio recording settings. ```APIDOC ## RecordConfig.fromMap(Map map) ### Description Creates a RecordConfig instance from a Map. This factory constructor parses a map to configure audio recording settings, providing default values for unspecified parameters. ### Method factory ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body - **map** (Map) - Required - A map containing the configuration parameters for RecordConfig. - **encoder** (String) - Optional - The audio encoder to use (e.g., 'aacLc'). Defaults to 'aacLc' if not specified or invalid. - **bitRate** (int) - Optional - The audio bit rate in bits per second. Defaults to 128000. - **sampleRate** (int) - Optional - The audio sample rate in Hz. Defaults to 44100. - **numChannels** (int) - Optional - The number of audio channels. Defaults to 2. - **device** (Map) - Optional - Configuration for the input device. If provided, it should be a Map that can be parsed by `InputDevice.fromMap`. - **autoGain** (bool) - Optional - Whether to enable automatic gain control. Defaults to false. - **echoCancel** (bool) - Optional - Whether to enable echo cancellation. Defaults to false. - **noiseSuppress** (bool) - Optional - Whether to enable noise suppression. Defaults to false. - **audioInterruption** (int) - Optional - The audio interruption mode, represented by an integer index corresponding to `AudioInterruptionMode.values`. Defaults to the index of `AudioInterruptionMode.pause`. - **streamBufferSize** (int) - Optional - The size of the stream buffer. ### Request Example ```json { "encoder": "aacLc", "bitRate": 192000, "sampleRate": 48000, "numChannels": 1, "device": { "deviceId": "default" }, "autoGain": true, "echoCancel": true, "noiseSuppress": false, "audioInterruption": 0, "streamBufferSize": 4096 } ``` ### Response #### Success Response (RecordConfig) Returns a `RecordConfig` object configured with the provided map values. #### Response Example (This is a conceptual representation, actual object structure depends on the Dart runtime) ```dart RecordConfig( encoder: AudioEncoder.aacLc, bitRate: 192000, sampleRate: 48000, numChannels: 1, device: InputDevice.fromMap({"deviceId": "default"}), autoGain: true, echoCancel: true, noiseSuppress: false, audioInterruption: AudioInterruptionMode.pause, streamBufferSize: 4096 ) ``` ``` -------------------------------- ### listInputDevices() Source: https://pub.dev/documentation/record/latest/record/AudioRecorder-class.html Retrieves a list of all available audio input devices on the platform. ```APIDOC listInputDevices() → Future> Lists capture/input devices available on the platform. ``` -------------------------------- ### InputDevice Constructors Source: https://pub.dev/documentation/record/latest/record/InputDevice-class.html Constructors for creating InputDevice objects. ```APIDOC ## Constructors InputDevice({required String id, required String label, InputDeviceType type = InputDeviceType.unknown, List sampleRates = const []}) const InputDevice.fromMap(Map map) factory ``` -------------------------------- ### RecordConfig Constructor Source: https://pub.dev/documentation/record/latest/record/RecordConfig-class.html Initializes a new RecordConfig instance with default or specified recording parameters. ```APIDOC ## RecordConfig Constructor ### Description Initializes a new RecordConfig instance with default or specified recording parameters. ### Parameters - **encoder** (AudioEncoder) - Optional - The audio encoder to be used for recording. Defaults to `AudioEncoder.aacLc`. - **bitRate** (int) - Optional - The audio encoding bit rate in bits per second. Defaults to 128000. - **sampleRate** (int) - Optional - The sample rate for audio in samples per second. Defaults to 44100. - **numChannels** (int) - Optional - The number of channels for the recording (1 = mono, 2 = stereo). Defaults to 2. - **device** (InputDevice?) - Optional - The device to be used for recording. If null, the default device will be selected. - **autoGain** (bool) - Optional - Whether the recorder should try to auto-adjust recording volume. Defaults to false. - **echoCancel** (bool) - Optional - Whether the recorder should try to reduce echo. Defaults to false. - **noiseSuppress** (bool) - Optional - Whether the recorder should try to negate input noise. Defaults to false. - **androidConfig** (AndroidRecordConfig) - Optional - Android-specific configuration. Defaults to an empty `AndroidRecordConfig`. - **iosConfig** (IosRecordConfig) - Optional - iOS-specific configuration. Defaults to an empty `IosRecordConfig`. - **audioInterruption** (AudioInterruptionMode) - Optional - Recorder behavior when audio is interrupted by another source. Defaults to `AudioInterruptionMode.pause`. - **streamBufferSize** (int?) - Optional - Buffer size for streaming data. Useful for finer data control when streaming. ``` -------------------------------- ### resume() Source: https://pub.dev/documentation/record/latest/record/AudioRecorder-class.html Resumes a previously paused audio recording session. ```APIDOC resume() → Future Resumes recording session after pause. ``` -------------------------------- ### AudioRecorder Constructor Implementation Source: https://pub.dev/documentation/record/latest/record/AudioRecorder/AudioRecorder.html Creates a new audio recorder instance. It initializes a unique recorder ID and sets up an asynchronous task to create the platform-specific recorder, ensuring thread safety with a semaphore. ```dart AudioRecorder() : _recorderId = UuidV4.generate() { _createFuture = () async { await _semaphore.acquire(); try { await _platform.create(_recorderId); } finally { _semaphore.release(); } }(); } ``` -------------------------------- ### InputDevice Constructor Source: https://pub.dev/documentation/record/latest/record/InputDevice/InputDevice.html The InputDevice constructor is used to create a new instance of the InputDevice class. It requires an id and a label, and optionally accepts a type and a list of sample rates. ```APIDOC ## InputDevice constructor const InputDevice({ 1. required String id, 2. required String label, 3. InputDeviceType type = InputDeviceType.unknown, 4. List sampleRates = const [], }) ### Parameters #### Path Parameters - **id** (String) - Required - Unique identifier for the input device. - **label** (String) - Required - A human-readable label for the input device. - **type** (InputDeviceType) - Optional - The type of the input device. Defaults to InputDeviceType.unknown. - **sampleRates** (List) - Optional - A list of supported sample rates for the input device. Defaults to an empty list. ### Implementation ```dart const InputDevice({ required this.id, required this.label, this.type = InputDeviceType.unknown, this.sampleRates = const [], }); ``` ``` -------------------------------- ### InputDevice Constructor Implementation Source: https://pub.dev/documentation/record/latest/record/InputDevice/InputDevice.html Provides the Dart implementation for the InputDevice constructor, initializing its properties. ```dart const InputDevice({ required this.id, required this.label, this.type = InputDeviceType.unknown, this.sampleRates = const [], }); ``` -------------------------------- ### RecordConfig Constructor Source: https://pub.dev/documentation/record/latest/record/RecordConfig/RecordConfig.html The RecordConfig constructor allows for detailed configuration of audio recording parameters, including encoder type, bitrate, sample rate, channel count, device selection, audio processing options, platform-specific configurations, interruption handling, and stream buffer size. ```APIDOC ## RecordConfig Constructor ### Description Initializes a new instance of the RecordConfig class with specified audio recording settings. ### Method `constructor` ### Parameters #### Constructor Parameters - **encoder** (AudioEncoder) - Optional - The audio encoder to use. Defaults to `AudioEncoder.aacLc`. - **bitRate** (int) - Optional - The audio bitrate in bits per second. Defaults to `128000`. - **sampleRate** (int) - Optional - The audio sample rate in Hz. Defaults to `44100`. - **numChannels** (int) - Optional - The number of audio channels. Defaults to `2`. - **device** (InputDevice?) - Optional - The input audio device to use. - **autoGain** (bool) - Optional - Enables or disables automatic gain control. Defaults to `false`. - **echoCancel** (bool) - Optional - Enables or disables echo cancellation. Defaults to `false`. - **noiseSuppress** (bool) - Optional - Enables or disables noise suppression. Defaults to `false`. - **androidConfig** (AndroidRecordConfig) - Optional - Configuration specific to Android. Defaults to an instance of `AndroidRecordConfig`. - **iosConfig** (IosRecordConfig) - Optional - Configuration specific to iOS. Defaults to an instance of `IosRecordConfig`. - **audioInterruption** (AudioInterruptionMode) - Optional - The mode for handling audio interruptions. Defaults to `AudioInterruptionMode.pause`. - **streamBufferSize** (int?) - Optional - The size of the stream buffer. ``` -------------------------------- ### InputDevice Methods Source: https://pub.dev/documentation/record/latest/record/InputDevice-class.html Methods available for the InputDevice class. ```APIDOC ## Methods noSuchMethod(Invocation invocation) → dynamic Invoked when a nonexistent method or property is accessed. inherited toSring() → String A string representation of this object. override ``` -------------------------------- ### InputDevice.fromMap Factory Constructor Implementation Source: https://pub.dev/documentation/record/latest/record/InputDevice/InputDevice.fromMap.html This factory constructor takes a Map and creates an InputDevice object. It handles potential null values for 'sampleRates' and ensures 'type' is correctly parsed. ```dart factory InputDevice.fromMap(Map map) => InputDevice( id: map['id'], label: map['label'], type: InputDeviceType.fromString(map['type'] as String?), sampleRates: List.from(map['sampleRates'] as List? ?? const []), ); ``` -------------------------------- ### listInputDevices method Source: https://pub.dev/documentation/record/latest/record/AudioRecorder/listInputDevices.html Lists capture/input devices available on the platform. On web, and in general, you should already have permission before accessing this method otherwise the list may return an empty list. ```APIDOC ## listInputDevices method ### Description Lists capture/input devices available on the platform. ### Method Signature `Future> listInputDevices()` ### Notes On web, and in general, you should already have permission before accessing this method otherwise the list may return an empty list. ``` -------------------------------- ### create Source: https://pub.dev/documentation/record/latest/record/RecordMethodChannelPlatformInterface/create.html Creates a recorder with the specified recorder ID. ```APIDOC ## create ### Description Creates a recorder. ### Method Signature Future create(String recorderId) ### Parameters #### Path Parameters - **recorderId** (String) - Required - The unique identifier for the recorder. ``` -------------------------------- ### AndroidRecordConfig Constructor Signature Source: https://pub.dev/documentation/record/latest/record/AndroidRecordConfig/AndroidRecordConfig.html Defines the parameters available for configuring Android audio recording. Defaults are provided for most options. ```dart const AndroidRecordConfig({ 1. bool useLegacy = false, 2. bool muteAudio = false, 3. bool manageBluetooth = true, 4. AndroidAudioSource audioSource = AndroidAudioSource.defaultSource, 5. bool speakerphone = false, 6. AudioManagerMode audioManagerMode = AudioManagerMode.modeNormal, }) ``` -------------------------------- ### IosRecordConfig Methods Source: https://pub.dev/documentation/record/latest/record/IosRecordConfig-class.html Methods available for the IosRecordConfig class. ```APIDOC ## Methods ### toMap Converts the `IosRecordConfig` object to a `Map`. ### toString Returns a string representation of the `IosRecordConfig` object. ``` -------------------------------- ### AndroidRecordConfig Constructor Source: https://pub.dev/documentation/record/latest/record/AndroidRecordConfig-class.html Constructs an AndroidRecordConfig object with customizable recording settings. ```APIDOC ## Constructors AndroidRecordConfig({bool useLegacy = false, bool muteAudio = false, bool manageBluetooth = true, AndroidAudioSource audioSource = AndroidAudioSource.defaultSource, bool speakerphone = false, AudioManagerMode audioManagerMode = AudioManagerMode.modeNormal}) const ``` -------------------------------- ### AndroidRecordConfig Methods Source: https://pub.dev/documentation/record/latest/record/AndroidRecordConfig-class.html Lists the available methods for the AndroidRecordConfig class. ```APIDOC ## Methods noSuchMethod(Invocation invocation) → dynamic Invoked when a nonexistent method or property is accessed. inherited toSring() → String A string representation of this object. inherited ``` -------------------------------- ### RecordPlatform() Source: https://pub.dev/documentation/record/latest/record/RecordPlatform-class.html Constructs an instance of the RecordPlatformInterface. ```APIDOC ## RecordPlatform() ### Description Constructs a RecordPlatformInterface. ### Method Constructor ``` -------------------------------- ### listInputDevices Source: https://pub.dev/documentation/record/latest/record/RecordMethodChannelPlatformInterface-class.html Lists all available capture/input devices on the platform for the specified recorder. ```APIDOC ## listInputDevices(String recorderId) ### Description Lists capture/input devices available on the platform. ### Method N/A (Method call) ### Parameters #### Path Parameters - **recorderId** (String) - Required - The unique identifier for the recorder. ### Response #### Success Response - **List** - A list of available input devices. ``` -------------------------------- ### Registering a Configuration Change Callback Source: https://pub.dev/documentation/record/latest/record/AudioRecorder/setOnConfigChanged.html Use this method to set a callback that will be triggered when the audio recording configuration is changed by the platform. Pass null to remove any previously set callback. ```dart Future setOnConfigChanged( void Function(RecordConfig config)? callback, ) { return _safeCall(() async { _platform.setOnConfigChanged(_recorderId, callback); }); } ``` -------------------------------- ### copyWith Method Source: https://pub.dev/documentation/record/latest/record/RecordConfig/copyWith.html Creates a new RecordConfig instance by copying the current instance and applying specified overrides. This is useful for immutably updating configuration objects. ```APIDOC ## copyWith Method ### Description Creates a new `RecordConfig` instance with the same fields as the original, but with the specified fields replaced. If a field is not specified, the original value is retained. ### Method Signature RecordConfig copyWith({ AudioEncoder? encoder, int? bitRate, int? sampleRate, int? numChannels, ({InputDevice? value})? device, bool? autoGain, bool? echoCancel, bool? noiseSuppress, AndroidRecordConfig? androidConfig, IosRecordConfig? iosConfig, AudioInterruptionMode? audioInterruption, ({int? value})? streamBufferSize, }) ### Parameters * **encoder** (AudioEncoder?) - Optional - The audio encoder to use. * **bitRate** (int?) - Optional - The bit rate for audio encoding. * **sampleRate** (int?) - Optional - The sample rate for audio recording. * **numChannels** (int?) - Optional - The number of audio channels. * **device** (({InputDevice? value})?) - Optional - The input audio device. * **autoGain** (bool?) - Optional - Whether to enable automatic gain control. * **echoCancel** (bool?) - Optional - Whether to enable echo cancellation. * **noiseSuppress** (bool?) - Optional - Whether to enable noise suppression. * **androidConfig** (AndroidRecordConfig?) - Optional - Configuration specific to Android. * **iosConfig** (IosRecordConfig?) - Optional - Configuration specific to iOS. * **audioInterruption** (AudioInterruptionMode?) - Optional - The audio interruption mode. * **streamBufferSize** (({int? value})?) - Optional - The size of the stream buffer. ### Returns A new `RecordConfig` instance with the updated fields. ``` -------------------------------- ### getIos Source: https://pub.dev/documentation/record/latest/record/RecordMethodChannelPlatformInterface-class.html Provides access to iOS platform-specific methods for the given recorder. ```APIDOC ## getIos(String recorderId) ### Description iOS platform specific methods. ### Method N/A (Method call) ### Parameters #### Path Parameters - **recorderId** (String) - Required - The unique identifier for the recorder. ### Response #### Success Response - **RecordIos?** - An object containing iOS-specific recording methods, or null if not on iOS or not supported. ``` -------------------------------- ### Abstract listInputDevices Method Signature Source: https://pub.dev/documentation/record/latest/record/RecordMethodChannelPlatformInterface/listInputDevices.html This is the abstract method signature for listing input devices. It returns a Future containing a list of InputDevice objects. On Android and iOS, an empty list is returned. On web, permissions should be granted beforehand. ```dart Future> listInputDevices( String recorderId ); ``` -------------------------------- ### RecordMethodChannelPlatformInterface() Source: https://pub.dev/documentation/record/latest/record/RecordMethodChannelPlatformInterface/RecordMethodChannelPlatformInterface.html Creates a new instance of the RecordMethodChannelPlatformInterface. ```APIDOC ## RecordMethodChannelPlatformInterface() ### Description Creates a new instance of the RecordMethodChannelPlatformInterface. ### Method constructor ### Endpoint N/A ### Parameters This constructor does not take any parameters. ### Response Returns an instance of RecordMethodChannelPlatformInterface. ``` -------------------------------- ### List Available Input Devices Source: https://pub.dev/documentation/record/latest/record/AudioRecorder/listInputDevices.html This method lists capture/input devices available on the platform. On web, and in general, you should already have permission before accessing this method otherwise the list may return an empty list. ```dart Future> listInputDevices() { return _safeCall(() => _platform.listInputDevices(_recorderId)); } ``` -------------------------------- ### RecordPlatform Constructor Implementation Source: https://pub.dev/documentation/record/latest/record/RecordPlatform/RecordPlatform.html The RecordPlatform constructor initializes the interface with a predefined token. ```dart RecordPlatform() : super(token: _token); ``` -------------------------------- ### Amplitude Methods Source: https://pub.dev/documentation/record/latest/record/Amplitude-class.html Details the available methods for the Amplitude class, including inherited methods like toString and noSuchMethod. ```APIDOC ## Amplitude Methods ### toString() → String #### Description A string representation of this object. ### noSuchMethod(Invocation invocation) → dynamic #### Description Invoked when a nonexistent method or property is accessed. ``` -------------------------------- ### InputDeviceType Static Methods Source: https://pub.dev/documentation/record/latest/record/InputDeviceType.html Information about the static methods available for the InputDeviceType enum, such as creating an enum value from a string. ```APIDOC ## Static Methods ### fromString(String? value) → InputDeviceType Converts a string representation to an InputDeviceType enum value. ``` -------------------------------- ### Amplitude Constructor Source: https://pub.dev/documentation/record/latest/record/Amplitude/Amplitude.html Initializes a new Amplitude object with current and maximum values. ```APIDOC ## Amplitude Constructor ### Description Initializes a new Amplitude object. ### Parameters #### Constructor Parameters - **current** (double) - Required - The current value. - **max** (double) - Required - The maximum value. ### Implementation ```dart Amplitude({required this.current, required this.max}); ``` ``` -------------------------------- ### InputDevice Properties Source: https://pub.dev/documentation/record/latest/record/InputDevice-class.html Properties of the InputDevice class. ```APIDOC ## Properties hashCode → int The hash code for this object. no setteroverride id → String The ID used to select the device on the platform. final label → String The label text representation. final runtimeType → Type A representation of the runtime type of the object. no setterinherited sampleRates → List The sample rates supported or prefered by this device. final type → InputDeviceType The transport type of this device. final ``` -------------------------------- ### RecordConfig Constructor Signature Source: https://pub.dev/documentation/record/latest/record/RecordConfig/RecordConfig.html Defines the parameters available for creating a RecordConfig instance, including default values for audio encoding, bit rate, sample rate, channels, and device-specific configurations. ```dart const RecordConfig({ 1. AudioEncoder encoder = AudioEncoder.aacLc, 2. int bitRate = 128000, 3. int sampleRate = 44100, 4. int numChannels = 2, 5. InputDevice? device, 6. bool autoGain = false, 7. bool echoCancel = false, 8. bool noiseSuppress = false, 9. AndroidRecordConfig androidConfig = const AndroidRecordConfig(), 10. IosRecordConfig iosConfig = const IosRecordConfig(), 11. AudioInterruptionMode audioInterruption = AudioInterruptionMode.pause, 12. int? streamBufferSize, }) ``` -------------------------------- ### Abstract Method Signature for manageAudioSession Source: https://pub.dev/documentation/record/latest/record/RecordIos/manageAudioSession.html This is the abstract method signature for managing the iOS audio session. Set `manage` to `true` to let the plugin activate the session and set categories, or `false` to maintain existing settings while allowing the plugin to adjust for recording requirements. ```dart Future manageAudioSession(bool manage); ``` -------------------------------- ### RecordConfig copyWith Implementation Source: https://pub.dev/documentation/record/latest/record/RecordConfig/copyWith.html This snippet shows the implementation of the copyWith method for the RecordConfig class. It creates a new RecordConfig instance, applying provided arguments or retaining existing values. ```dart RecordConfig copyWith({ AudioEncoder? encoder, int? bitRate, int? sampleRate, int? numChannels, ({InputDevice? value})? device, bool? autoGain, bool? echoCancel, bool? noiseSuppress, AndroidRecordConfig? androidConfig, IosRecordConfig? iosConfig, AudioInterruptionMode? audioInterruption, ({int? value})? streamBufferSize, }) { return RecordConfig( encoder: encoder ?? this.encoder, bitRate: bitRate ?? this.bitRate, sampleRate: sampleRate ?? this.sampleRate, numChannels: numChannels ?? this.numChannels, device: device != null ? device.value : this.device, autoGain: autoGain ?? this.autoGain, echoCancel: echoCancel ?? this.echoCancel, noiseSuppress: noiseSuppress ?? this.noiseSuppress, androidConfig: androidConfig ?? this.androidConfig, iosConfig: iosConfig ?? this.iosConfig, audioInterruption: audioInterruption ?? this.audioInterruption, streamBufferSize: streamBufferSize != null ? streamBufferSize.value : this.streamBufferSize, ); } ``` -------------------------------- ### IosRecordConfig Constructor Implementation Source: https://pub.dev/documentation/record/latest/record/IosRecordConfig/IosRecordConfig.html This is the Dart implementation of the IosRecordConfig constructor. It initializes default values for categoryOptions and allowHapticsAndSystemSoundsDuringRecording. ```dart const IosRecordConfig({ this.categoryOptions = const [ IosAudioCategoryOption.defaultToSpeaker, IosAudioCategoryOption.allowBluetooth, IosAudioCategoryOption.allowBluetoothA2DP, ], this.allowHapticsAndSystemSoundsDuringRecording = false, }); ``` -------------------------------- ### toMap Method Implementation Source: https://pub.dev/documentation/record/latest/record/IosRecordConfig/toMap.html Converts the record configuration object into a Map. It serializes category options into a comma-separated string and includes the boolean flag for haptics and system sounds. ```dart Map toMap() { return { "categoryOptions": categoryOptions.map((e) => e.name).join(','), "allowHapticsAndSystemSoundsDuringRecording": allowHapticsAndSystemSoundsDuringRecording, }; } ``` -------------------------------- ### RecordConfig Constructor Implementation Source: https://pub.dev/documentation/record/latest/record/RecordConfig/RecordConfig.html Provides the Dart implementation for the RecordConfig constructor, assigning the provided or default values to the class members. ```dart const RecordConfig({ this.encoder = AudioEncoder.aacLc, this.bitRate = 128000, this.sampleRate = 44100, this.numChannels = 2, this.device, this.autoGain = false, this.echoCancel = false, this.noiseSuppress = false, this.androidConfig = const AndroidRecordConfig(), this.iosConfig = const IosRecordConfig(), this.audioInterruption = AudioInterruptionMode.pause, this.streamBufferSize, }); ``` -------------------------------- ### IosAudioCategoryOption Enum Values Source: https://pub.dev/documentation/record/latest/record/IosAudioCategoryOption.html These are the available options for configuring audio session behaviors. Each option can be used to modify how the app's audio interacts with other audio or system events. ```APIDOC ## Enum: IosAudioCategoryOption Constants that specify optional audio behaviors. ### Values - **mixWithOthers** Allows audio mixing with other apps. - **duckOthers** Automatically ducks other audio when this app's audio plays. - **allowBluetooth** Allows audio routing to Bluetooth devices. - **defaultToSpeaker** Defaults audio output to the speaker, even if a headset is connected. - **interruptSpokenAudioAndMixWithOthers** Interrupts spoken audio and mixes with other audio. Available from iOS 9.0. - **allowBluetoothA2DP** Allows audio routing to A2DP Bluetooth devices. Available from iOS 10.0. - **allowAirPlay** Allows audio routing to AirPlay devices. Available from iOS 10.0. - **overrideMutedMicrophoneInterruption** Overrides the interruption of a muted microphone. Available from iOS 14.5. ### Properties - **hashCode** (int) - The hash code for this object. - **index** (int) - A numeric identifier for the enumerated value. - **name** (String) - The name of the enum value. - **runtimeType** (Type) - A representation of the runtime type of the object. ### Methods - **noSuchMethod(Invocation invocation)** (dynamic) - Invoked when a nonexistent method or property is accessed. - **toString()** (String) - A string representation of this object. ### Operators - **operator ==(Object other)** (bool) - The equality operator. ### Constants - **values** (List) - A constant List of the values in this enum, in order of their declaration. ``` -------------------------------- ### listInputDevices(String recorderId) Source: https://pub.dev/documentation/record/latest/record/RecordPlatform-class.html Lists all available capture/input devices on the platform for the specified recorder. ```APIDOC ## listInputDevices(String recorderId) ### Description Lists capture/input devices available on the platform. ### Method `listInputDevices` ### Parameters #### Path Parameters - **recorderId** (String) - Required - The unique identifier for the recorder. ### Response #### Success Response (List) - **List** - A list of available input devices. ``` -------------------------------- ### InputDevice toMap Implementation Source: https://pub.dev/documentation/record/latest/record/InputDevice/toMap.html Converts an InputDevice object to a Map. Includes 'sampleRates' if the list is not empty. ```dart Map toMap() => { 'id': id, 'label': label, 'type': type.name, if (sampleRates.isNotEmpty) 'sampleRates': sampleRates, }; ``` -------------------------------- ### getIos Method Implementation Source: https://pub.dev/documentation/record/latest/record/RecordPlatform/getIos.html This is the default implementation of the getIos method. It returns null, indicating that the method is not intended for use on non-iOS platforms or that no specific iOS implementation is provided here. ```dart @override RecordIos? getIos(String recorderId) => null; ``` -------------------------------- ### Amplitude Constructor Implementation Source: https://pub.dev/documentation/record/latest/record/Amplitude/Amplitude.html Provides the Dart implementation for the Amplitude constructor, initializing the current and max properties. ```Dart Amplitude({required this.current, required this.max}); ``` -------------------------------- ### create(String recorderId) Source: https://pub.dev/documentation/record/latest/record/RecordPlatform-class.html Creates a recorder instance identified by the provided recorderId. ```APIDOC ## create(String recorderId) ### Description Create a recorder ### Method `create` ### Parameters #### Path Parameters - **recorderId** (String) - Required - The unique identifier for the recorder. ``` -------------------------------- ### AndroidRecordConfig Implementation Source: https://pub.dev/documentation/record/latest/record/AndroidRecordConfig/AndroidRecordConfig.html The actual implementation of the AndroidRecordConfig constructor, assigning default values to its properties. ```dart const AndroidRecordConfig({ this.useLegacy = false, this.muteAudio = false, this.manageBluetooth = true, this.audioSource = AndroidAudioSource.defaultSource, this.speakerphone = false, this.audioManagerMode = AudioManagerMode.modeNormal, }); ``` -------------------------------- ### macOS Audio Input Entitlement Source: https://pub.dev/documentation/record/latest/index.html Add this entitlement to your `macos/Runner/Info.plist` or `*.entitlements` file to enable audio input on macOS. ```xml com.apple.security.device.audio-input ``` -------------------------------- ### hasPermission() Source: https://pub.dev/documentation/record/latest/record/AudioRecorder-class.html Checks if the application has permission to record audio and optionally requests it if not granted. ```APIDOC hasPermission({bool request = true}) → Future Checks and optionally requests for audio record permission. ``` -------------------------------- ### getIos Abstract Method Signature Source: https://pub.dev/documentation/record/latest/record/RecordMethodChannelPlatformInterface/getIos.html This is the abstract method signature for `getIos`. It takes a recorderId and returns a nullable RecordIos object. Returns null when not on the iOS platform. ```dart RecordIos? getIos(String recorderId); ``` -------------------------------- ### hasPermission method Source: https://pub.dev/documentation/record/latest/record/AudioRecorder/hasPermission.html Checks and optionally requests for audio record permission. The `request` parameter controls whether to request permission if not already granted. Defaults to `true`. ```APIDOC ## hasPermission ### Description Checks and optionally requests for audio record permission. ### Parameters #### Query Parameters - **request** (bool) - Optional - Controls whether to request permission if not already granted. Defaults to `true`. ### Returns - **Future** - A future that resolves to `true` if permission is granted or was successfully requested, `false` otherwise. ``` -------------------------------- ### toMap Method Source: https://pub.dev/documentation/record/latest/record/RecordConfig-class.html Converts the RecordConfig instance to a map. ```APIDOC ## toMap Method ### Description Converts the RecordConfig instance into a Map representation, suitable for serialization. ### Returns - **Map** - A map containing the configuration details. ``` -------------------------------- ### Abstract Create Method Signature Source: https://pub.dev/documentation/record/latest/record/RecordMethodChannelPlatformInterface/create.html This is the abstract method signature for creating a recorder. It takes a recorderId as a String. ```dart Future create( String recorderId ); ``` -------------------------------- ### hasPermission Abstract Method Signature Source: https://pub.dev/documentation/record/latest/record/RecordMethodChannelPlatformInterface/hasPermission.html This is the abstract method signature for checking and requesting audio recording permissions. The `request` parameter determines if permission should be requested if it's not already granted. ```dart Future hasPermission(String recorderId, {bool request = true}); ``` -------------------------------- ### toMap Source: https://pub.dev/documentation/record/latest/record/InputDevice/toMap.html Converts the InputDevice object to a Map. This method includes the 'id', 'label', and 'type' of the device. If 'sampleRates' is not empty, it is also included in the map. ```APIDOC ## toMap ### Description Converts the InputDevice object to a Map. This method includes the 'id', 'label', and 'type' of the device. If 'sampleRates' is not empty, it is also included in the map. ### Method ```dart Map toMap() ``` ### Returns A `Map` representing the InputDevice. ### Implementation Details ```dart Map toMap() => { 'id': id, 'label': label, 'type': type.name, if (sampleRates.isNotEmpty) 'sampleRates': sampleRates, }; ``` ``` -------------------------------- ### pause() Source: https://pub.dev/documentation/record/latest/record/AudioRecorder-class.html Pauses the current audio recording session. ```APIDOC pause() → Future Pauses recording session. ```