Skip to content

🎥 Make videos programmatically with React

cool

Jonny Burgerf9a2b1c95fdc
diff --git a/packages/docs/docs/use-audio-data.mdx b/packages/docs/docs/use-audio-data.mdx
index bd409d4732..f6ae13bc6c 100644
--- a/packages/docs/docs/use-audio-data.mdx
+++ b/packages/docs/docs/use-audio-data.mdx
@@ -109,6 +109,17 @@ To determine if a file has an audio track, you may use the [`getVideoMetadata()`
If you want to catch the error in the component, you need to make your own inline hook by taking the source code from the bottom of this page.
+## Types
+
+### `UseAudioDataOptions`<AvailableFrom v="4.0.458"/>
+
+```ts twoslash
+import type {
+ UseAudioDataOptions,
+ // ^?
+} from '@remotion/media-utils';
+```
+
## See also
- [Source code for this function](https://github.com/remotion-dev/remotion/blob/main/packages/media-utils/src/use-audio-data.ts)
diff --git a/packages/media-utils/src/index.ts b/packages/media-utils/src/index.ts
index 66961ca73a..ba776d2ad5 100644
--- a/packages/media-utils/src/index.ts
+++ b/packages/media-utils/src/index.ts
@@ -14,7 +14,7 @@ export type {
MediaUtilsAudioData,
VideoMetadata as VideoData,
} from './types';
-export {useAudioData} from './use-audio-data';
+export {UseAudioDataOptions, useAudioData} from './use-audio-data';
export {
UseWindowedAudioDataOptions,
UseWindowedAudioDataReturnValue,
diff --git a/packages/media-utils/src/use-audio-data.ts b/packages/media-utils/src/use-audio-data.ts
index 396cca35fc..d3104a5f9e 100644
--- a/packages/media-utils/src/use-audio-data.ts
+++ b/packages/media-utils/src/use-audio-data.ts
@@ -3,7 +3,7 @@ import {cancelRender, useDelayRender} from 'remotion';
import {getAudioData} from './get-audio-data';
import type {MediaUtilsAudioData} from './types';
-type UseAudioDataOptions = {
+export type UseAudioDataOptions = {
sampleRate?: number;
/**
* Captured only from the first render and passed to `fetch()`.