1 Star 0 Fork 3

林嘉诚/rntpc_react-native-audio

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
NativeAudio.js 1.19 KB
一键复制 编辑 原始数据 按行查看 历史
林嘉诚 提交于 2024-11-17 17:18 . feat: add HarmonyOS support
import type { TurboModule } from "react-native/Libraries/TurboModule/RCTExport";
import { TurboModuleRegistry } from "react-native";
import type { Int32, Double } from 'react-native/Libraries/Types/CodegenTypes';
type AudioQualityType = 'Low' | 'Medium' | 'High';
type RecordingOptions = $ReadOnly<{|
SampleRate: Double,
Channels: Int32,
AudioQuality?: AudioQualityType,
AudioEncoding: string,
MeteringEnabled?: boolean,
MeasurementMode?: boolean,
AudioEncodingBitRate: Double,
IncludeBase64: boolean,
OutputFormat: string,
AudioSource: Int32
|}>;
type PathMap = $ReadOnly<{|
FilesDirectoryPath: string,
CacheDirectoryPath: string,
TempsDirectoryPath: string,
|}>;
export interface Spec extends TurboModule {
prepareRecordingAtPath: (path: string, options: RecordingOptions) => Promise<void>;
requestAuthorization: () => Promise<boolean>;
startRecording: () => Promise<void>;
pauseRecording: () => Promise<void>;
resumeRecording: () => Promise<void>;
stopRecording: () => Promise<void>;
getAllPath: () => PathMap;
checkAuthorizationStatus: () => Promise<boolean>;
}
export default TurboModuleRegistry.getEnforcing<Spec>("RTNAudio");
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/LLLLLLin/rntpc_react-native-audio.git
git@gitee.com:LLLLLLin/rntpc_react-native-audio.git
LLLLLLin
rntpc_react-native-audio
rntpc_react-native-audio
master

搜索帮助

0d507c66 1850385 C8b1a773 1850385