Giter VIP home page Giter VIP logo

Comments (4)

jiwenjiang avatar jiwenjiang commented on June 6, 2024

目前我这个插件暂时无法解决你的需求。
但是我可以提供一个思路,比如你可以把项目fork下来,在https://github.com/jiwenjiang/react-audio-analyser/blob/e63193b3f413b0c60deb0d54fdada74e8ba40d02/src/component/AudioAnalyser/RenderCanvas.js#L53 这里找到音频上下文中拿到的音频信息数组(是一个长度为2048的类型数组,默认值都为128,录音信息会在128上下波动),通过设立一个阈值,来标记你认为有效音频的音频范围(实际开发这个功能在这个函数外边去操作,这里只是方便你查看),做一个debounce,在一定时间内如果满足你的阈值,就将之前的音频存储下来,然后记录新的音频。

from react-audio-analyser.

wentao978 avatar wentao978 commented on June 6, 2024

image

我看到这里了,可以获取波形数据和频域数据,那么获取的频域数据是Float32Array的数据,如何再重新转换成wav呢? 现在看你的转换是将getUserMedia获取的MediaStream -> AudioBuffer -> wav

from react-audio-analyser.

jiwenjiang avatar jiwenjiang commented on June 6, 2024

本身获取的音频数据,只是为了让你知道什么时候去做音频的分片,并不是在那里拿。
你可以在做wav转换这里来进行你的操作,把音频上下文去转换类型数组的这个逻辑拿出来,放在转码wav的地方,当满足你对音频分片的逻辑时,就把这个wav取出来就行了。简单说,类型数组使你用来判断什么时间节点来分片的。

from react-audio-analyser.

wentao978 avatar wentao978 commented on June 6, 2024

您好,我想了很久,还是没有想到如何操作,能不能帮我一下呢?

from react-audio-analyser.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.