Skip to content

Commit d905852

Browse files
committed
correct codec config type
1 parent a2ee2ad commit d905852

File tree

1 file changed

+3
-10
lines changed

1 file changed

+3
-10
lines changed

packages/av-cliper/src/combinator.ts

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ export interface ICombinatorOpts {
1010
fps?: number;
1111
bgColor?: string;
1212
videoCodec?: string;
13-
audioCodec?: string;
13+
audioCodec?: 'opus' | 'aac';
1414
opusConfig?: object;
1515
/**
1616
* false 合成的视频文件中排除音轨
@@ -91,20 +91,13 @@ export class Combinator {
9191
})
9292
).supported ??
9393
false) &&
94-
((
95-
await self.AudioEncoder.isConfigSupported({
96-
codec: DEFAULT_AUDIO_CONF.codec,
97-
sampleRate: DEFAULT_AUDIO_CONF.sampleRate,
98-
numberOfChannels: DEFAULT_AUDIO_CONF.channelCount,
99-
})
100-
).supported) ||
10194
(
10295
await self.AudioEncoder.isConfigSupported({
103-
codec: args.audioCodec,
96+
codec: args.audioCodec ?? DEFAULT_AUDIO_CONF.codec,
10497
sampleRate: DEFAULT_AUDIO_CONF.sampleRate,
10598
numberOfChannels: DEFAULT_AUDIO_CONF.channelCount,
10699
})
107-
).supported)) ??
100+
).supported) ??
108101
false
109102
);
110103
}

0 commit comments

Comments
 (0)