Git Product home page Git Product logo

Comments (3)

lijinke666 avatar lijinke666 commented on May 25, 2024

@himanshu31shr Hi~ The component current version use <audio preload="auto"/> , so download the entire file as a result of initialization. that's so bad . i think should be remove preload attribute
I'm try use Web Audio Api suport stream , and download section in the next version .

from react-music-player.

himanshu31shr avatar himanshu31shr commented on May 25, 2024

@lijinke666 Sounds great! For now i managed to build api for streaming audio using node fs. Is there any other way around you know?

from react-music-player.

lijinke666 avatar lijinke666 commented on May 25, 2024

if you are use fs module . I'dont know your context is server ? are you server rendering?

if it is client , Should not be used fs

currently I'm still trying.

            const reader = new FileReader()
            reader.onload = (e) => {
                const result = e.target.result
                const audio = new AudioContext()
                audio.decodeAudioData(result, (buffer) => {    
                    const node = audio.createBufferSource()
                    node.buffer = buffer                    
                    node.connect(audio.destination)   
                    node.start(0)      
                }, (err) => {
                })
            }
            reader.readAsArrayBuffer(YOUR_DATA)   

or use URL.createObjectURL

audio.src = window.URL.createObjectURL(BLOB);

in the feat-audio-stream I have fixed some known bugs 。Audio loading has also become faster 。and I'm still trying something , We can also help each other。like pull a pr 👍

from react-music-player.

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.