All Projects → jiwenjiang → react-audio-analyser

jiwenjiang / react-audio-analyser

Licence: MIT License
基于react录音及绘制音频曲线

Programming Languages

javascript
184084 projects - #8 most used programming language
HTML
75241 projects
CSS
56736 projects

Projects that are alternatives of or similar to react-audio-analyser

NaraeAudioRecorder
AudioRecorder for Android powered by Kotlin
Stars: ✭ 82 (+18.84%)
Mutual labels:  audio-recorder
Vienna
Vienna 是一款安卓音频操作工具,主要提供音频录制与播放的功能。提供简洁的接口降低音频开发的成本。
Stars: ✭ 43 (-37.68%)
Mutual labels:  audio-recorder
SoundDeck
Sound Deck is a powerful audio-focused plugin for the Elgato Stream Deck.
Stars: ✭ 20 (-71.01%)
Mutual labels:  audio-recorder
orcanode
Software for live-streaming and recording lossy or lossless compressed audio (HLS, DASH, FLAC) via AWS S3 buckets. ⭐
Stars: ✭ 23 (-66.67%)
Mutual labels:  audio-recorder
android-audio-sensei
High-level library to make android audio recording and playing more simple by handling boring stuff like runtime permissions and by completely abstracting audio playback controller
Stars: ✭ 41 (-40.58%)
Mutual labels:  audio-recorder
flutter sound
Flutter plugin for sound. Audio recorder and player.
Stars: ✭ 727 (+953.62%)
Mutual labels:  audio-recorder
vue-dictaphone
🎙️ Vue.js dictaphone component to record audio from the user
Stars: ✭ 22 (-68.12%)
Mutual labels:  audio-recorder
reco
A simple audio recording app for modern Linux desktop environment like Pantheon
Stars: ✭ 47 (-31.88%)
Mutual labels:  audio-recorder
simple-web-audio-recorder-demo
A simple HTML/JS demo that uses WebAudioRecorder.js to record audio on a web page
Stars: ✭ 141 (+104.35%)
Mutual labels:  audio-recorder
hermes-audio-server
An open source implementation of the audio server part of the Hermes protocol
Stars: ✭ 23 (-66.67%)
Mutual labels:  audio-recorder
fast-mixer
Mini recording and mixing studio for android
Stars: ✭ 47 (-31.88%)
Mutual labels:  audio-recorder
Android-Wave-Recorder
A powerful and efficient library to record WAVE form audio files (WAV) in Android
Stars: ✭ 137 (+98.55%)
Mutual labels:  audio-recorder
simple-vmsg-demo
A plain HTML/JS demo that uses vmsg (a modern WebAssembly version of LAME) to record and encode mp3 audio in the browser
Stars: ✭ 17 (-75.36%)
Mutual labels:  audio-recorder
svar
SVAR - Simple Voice Activated Recorder
Stars: ✭ 24 (-65.22%)
Mutual labels:  audio-recorder
KTAudioSoundWave
🍐KTSoundWave-根据语音绘制波浪动画,录音波形图及分贝检测
Stars: ✭ 22 (-68.12%)
Mutual labels:  audio-recorder
audiobug
A simple Android app to record audio through the microphone.
Stars: ✭ 19 (-72.46%)
Mutual labels:  audio-recorder
CallRecorder
SW Call Recorder is an Android app that records phone calls based on user selected phone numbers.
Stars: ✭ 56 (-18.84%)
Mutual labels:  audio-recorder

English | 简体中文

react-audio-analyser

GitHub

recording audio and drawing the curve. support for converting the audio to wav.

Demo

Check out the demo.

Installation

npm install react-audio-analyser --save

Features

  • Record audio and show the curve
  • Support output audio/wav,audio/mp3,audio/webm
  • Various state callbacks
  • Support the introduction of multiple components(reference)

Example

import React, {Component} from "react";
import "./index.css";
import AudioAnalyser from "react-audio-analyser"


export default class demo extends Component {
    constructor(props) {
        super(props)
        this.state = {
            status: ""
        }
    }

    componentDidMount() {
    }

    controlAudio(status) {
        this.setState({
            status
        })
    }

    changeScheme(e) {
        this.setState({
            audioType: e.target.value
        })
    }

    render() {
        const {status, audioSrc, audioType} = this.state;
        const audioProps = {
            audioType,
            // audioOptions: {sampleRate: 30000}, // 设置输出音频采样率
            status,
            audioSrc,
            timeslice: 1000, // timeslice(https://developer.mozilla.org/en-US/docs/Web/API/MediaRecorder/start#Parameters)
            startCallback: (e) => {
                console.log("succ start", e)
            },
            pauseCallback: (e) => {
                console.log("succ pause", e)
            },
            stopCallback: (e) => {
                this.setState({
                    audioSrc: window.URL.createObjectURL(e)
                })
                console.log("succ stop", e)
            },
            onRecordCallback: (e) => {
                console.log("recording", e)
            },
            errorCallback: (err) => {
                console.log("error", err)
            }
        }
        return (
            <div>
                <AudioAnalyser {...audioProps}>
                    <div className="btn-box">
                        {status !== "recording" &&
                        <i className="iconfont icon-start" title="开始"
                           onClick={() => this.controlAudio("recording")}></i>}
                        {status === "recording" &&
                        <i className="iconfont icon-pause" title="暂停"
                           onClick={() => this.controlAudio("paused")}></i>}
                        <i className="iconfont icon-stop" title="停止"
                           onClick={() => this.controlAudio("inactive")}></i>
                    </div>
                </AudioAnalyser>
                <p>choose output type</p>
                <select name="" id="" onChange={(e) => this.changeScheme(e)} value={audioType}>
                    <option value="audio/webm">audio/webm(default)</option>
                    <option value="audio/wav">audio/wav</option>
                    <option value="audio/mp3">audio/mp3</option>
                </select>
            </div>
        );
    }
}

Properties(audioProps)

Properties Description Default IsRequired
status recording start , paused pause , inactive stop undefined yes
audioType audio output type audio/webm no
timeslice The number of milliseconds to record into each Blob undefined no
audioSrc window.URL.createObjectURL of output audio blob ,when the prop set, showing the audio control list null no
startCallback Function triggered after starting(resuming) recording undefined no
pauseCallback Function triggered after pausing recording undefined no
stopCallback Function triggered after stoping recording undefined no
onRecordCallback Function triggered after setting timeslice or stoping recording undefined no
errorCallback Function triggered after error undefined no
backgroundColor audio canvas backgroundColor rgba(0, 0, 0, 1) no
strokeColor audio canvas strokeColor #ffffff no
className audio canvas css classname audioContainer no
audioBitsPerSecond audioBitsPerSecond 128000 no
width audio canvas width 500px no
height audio canvas height 100px no
audioOptions output audio/wav options {} no
audioOptions.sampleRate output audio/wav sampleRate no

License

MIT

TODO

  • output audio/mp3 (completed)
  • Diverse audio curve display
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].