Skip to content

lodev09/expo-recorder

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

35 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Expo Recorder

Audio recorder for your React Native apps ๐ŸŽ™๏ธ
This is a wrapper component that implements Expo Audio and features an animated waveform for your recording needs. ๐Ÿ’ช

Expo Recorder

Note

This package is mostly subjective and might not fit your use case and/or design.

I will try to make this as generic as possible, but if you want a very customized experience, feel free to copy its code and customize it the way you want. Alternatively, you could submit a PR if you think it will help the general public. See the contributing guide to get started.

Installation

npx expo install @lodev09/expo-recorder

Dependencies

npx expo install expo-audio react-native-reanimated react-native-gesture-handler

You might want to check out the individual installation instructions from this package's dependencies.

Usage

import { View, Button, Alert } from 'react-native'
import { Recorder, type RecorderRef } from '@lodev09/expo-recorder'
import { Audio } from "expo-av";

const App = () => {
  const recorder = useRef<RecorderRef>(null)

  const startRecording = async () => {
    try {
      const permission = await Audio.requestPermissionsAsync();
      if (permission.status !== "granted") {
        Alert.alert(
          "Permission required",
          "Audio recording permission is required"
        );
        return;
      }

      const record = await recorder.current?.startRecording();
      console.log(record?.uri);
    } catch (error) {
      console.error(error);
    }
  };

  const stopRecording = async () => {
    const record = await recorder.current?.stopRecording()
    console.log(record.uri) // Save the uri somewhere! ๐ŸŽ‰
  }

  return (
    <View>
      <Recorder ref={recorder} />
      <Button title="Record" onPress={startRecording} />
      <Button title="Stop" onPress={stopRecording} />
    </View>
  )
}

For complete usage, see example.

Also check out react-native-true-sheet, the Bottom Sheet used in this example.

Contributing

See the contributing guide to learn how to contribute to the repository and the development workflow.

License

MIT


Made with โค๏ธ by @lodev09

About

Audio recorder for your React Native apps ๐ŸŽ™๏ธ

Resources

License

Code of conduct

Contributing

Stars

Watchers

Forks

Packages

 
 
 

Contributors