Skip to content

Commit dc001ec

Browse files
authored
docs: add unit annotations to FileInfo (#1001)
1 parent 5c3af3c commit dc001ec

2 files changed

Lines changed: 18 additions & 0 deletions

File tree

packages/audiodocs/docs/inputs/audio-recorder.mdx

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -405,6 +405,8 @@ export default MyRecorder;
405405
<td>
406406
<div class="text-content">
407407
Stops the input stream and cleans up each input access method.
408+
409+
For details on the returned file information check: [FileInfo](#fileinfo)
408410
</div>
409411
```tsx
410412
const result = audioRecorder.stop();
@@ -754,6 +756,20 @@ enum FileFormat {
754756
}
755757
```
756758

759+
#### FileInfo
760+
761+
```tsx
762+
interface FileInfo {
763+
path: string;
764+
size: number;
765+
duration: number;
766+
}
767+
```
768+
769+
- `path` - The path to the recorded audio file.
770+
- `size` - The file size (in MB).
771+
- `duration` - The recording duration (in seconds).
772+
757773
#### FilePresetType
758774

759775
Describes audio format that is used during writing to file as well as encoded final file properties. You can use one of predefined presets, or fully customize the result file, but be aware that the properties aren't limited to only valid configurations, you may find property pairs that will result in error result during recording start (or when enabling the file output during active input session)!

packages/react-native-audio-api/src/types.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,9 @@ export interface AudioRecorderFileOptions {
102102

103103
export interface FileInfo {
104104
path: string;
105+
/** The size of the recorded file (in MB). */
105106
size: number;
107+
/** The duration of the recording (in seconds). */
106108
duration: number;
107109
}
108110

0 commit comments

Comments
 (0)