Overview
The Mobile SDK provides you the capability to manage the full lifecycle of an ambient session using the following recording controls. These methods allow you to start, pause, resume, and stop a recording with full state management. The diagram below illustrates the possible states of a session and the methods that cause a transition from one state to another.Prerequisites
Before calling any of these methods, always ensure the SDK is initialized and a session has been created to prevent runtime errors.appIsNotActive error. You should handle this case by notifying the user.Recording controls
These are the recording controls that are available in the Mobile SDK:Start Recording
You can begin capturing audio by calling thestart method. This transitions the session into the Recording state.
Pause Recording
To temporarily stop capturing audio while keeping the session active, call thepause method. This transitions the session into the Paused state.
Resume Recording
If a session is paused, you can call theresume method to continue capturing audio. This transitions the session into the Recording state.
End Session
To stop the recording and begin the content generation process, call theend method. This is the standard way to complete a session successfully.
Cancel Session
To stop the recording and discard all captured data, call thecancel method. This action cannot be undone.
Error Handling
All recording control methods can throw aSukiAmbientCoreError. You must use a do-catch block to handle potential issues, such as calling a method from an invalid state.
FAQs
Why can't I start a recording in the background?
Why can't I start a recording in the background?
appIsNotActive error. You should handle this case by notifying the user.What happens if I call a method from an invalid state?
What happens if I call a method from an invalid state?
SukiAmbientCoreError. You must use a do-catch block to handle potential issues, such as calling a method from an invalid state.How do I handle errors from the recording control methods?
How do I handle errors from the recording control methods?
SukiAmbientCoreError. You must use a do-catch block to handle potential issues, such as calling a method from an invalid state.Do I need to call the `end` method to generate a note?
Do I need to call the `end` method to generate a note?
end method to generate a note. The end method transitions the session into the Ended state, which is required for note generation.Can I cancel a session after it has been ended?
Can I cancel a session after it has been ended?
cancel method transitions the session into the Canceled state, which is required for note generation.Can I pause and resume a session?
Can I pause and resume a session?
pause and resume methods transition the session into the Paused and Recording states, respectively.Can I start a recording after it has been ended?
Can I start a recording after it has been ended?
start method transitions the session into the Recording state, which is required for note generation.As a developer, how do I know if a session has been ended?
As a developer, how do I know if a session has been ended?
sessionState property to determine the current state of the session.What is the best way to handle user interactions with the recording controls?
What is the best way to handle user interactions with the recording controls?
sessionState property to determine the current state of the session and only enable the recording controls when the session is in the Recording state.If the user cancels a session, what happens to the audio and session data?
If the user cancels a session, what happens to the audio and session data?