# RecordingStats

Artifact: [androidx.camera:camera-video](https://developer.android.com/jetpack/androidx/releases/camera) [View Source](https://cs.android.com/search?q=file:androidx/camera/video/RecordingStats.java+class:androidx.camera.video.RecordingStats) Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/camera#1.1.0)

*** ** * ** ***


```
@AutoValue
abstract class RecordingStats
```

<br />

*** ** * ** ***

A snapshot of statistics about an `https://developer.android.com/reference/kotlin/androidx/camera/video/Recording` at a point in time.

Recording stats provide information about a recording such as file size, duration and other useful statistics which may be useful for tracking the state of a recording.

Recording stats are generated for every `https://developer.android.com/reference/kotlin/androidx/camera/video/VideoRecordEvent` and can be retrieved via `https://developer.android.com/reference/kotlin/androidx/camera/video/VideoRecordEvent#getRecordingStats()`.

| See also |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/camera/video/PendingRecording#start(java.util.concurrent.Executor,androidx.core.util.Consumer<androidx.camera.video.VideoRecordEvent>)` |   |

## Summary

| ### Public functions |
|---|---|
| `abstract https://developer.android.com/reference/kotlin/androidx/camera/video/AudioStats` | `https://developer.android.com/reference/kotlin/androidx/camera/video/RecordingStats#getAudioStats()()` Returns the `https://developer.android.com/reference/kotlin/androidx/camera/video/AudioStats` that is associated with this recording stats. |
| `abstract https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html` | `https://developer.android.com/reference/kotlin/androidx/camera/video/RecordingStats#getNumBytesRecorded()()` Returns the number of bytes recorded. |
| `abstract https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html` | `https://developer.android.com/reference/kotlin/androidx/camera/video/RecordingStats#getRecordedDurationNanos()()` Returns current recorded duration in nanoseconds. |

## Public functions

### getAudioStats

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/camera#1.1.0)

```
abstract fun getAudioStats(): AudioStats
```

Returns the `https://developer.android.com/reference/kotlin/androidx/camera/video/AudioStats` that is associated with this recording stats.

### getNumBytesRecorded

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/camera#1.1.0)

```
abstract fun getNumBytesRecorded(): Long
```

Returns the number of bytes recorded.

The number of bytes recorded includes bytes stored for video and for audio, if applicable.

| Returns |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html` | the total number of bytes stored for the recording at the time of these recording stats being generated. |

### getRecordedDurationNanos

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/camera#1.1.0)

```
abstract fun getRecordedDurationNanos(): Long
```

Returns current recorded duration in nanoseconds.

The duration represents the realtime number of nanoseconds that have transpired since the recording started, excluding intervals where the recording was paused.

| Returns |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html` | the duration, in nanoseconds, of the recording at the time of these recording stats being generated. |