mp3-duration | Replaced usage of failure with thiserror for error

 by   agersant Rust Version: Current License: MIT

kandi X-RAY | mp3-duration Summary

kandi X-RAY | mp3-duration Summary

mp3-duration is a Rust library. mp3-duration has no bugs, it has no vulnerabilities, it has a Permissive License and it has low support. You can download it from GitHub.

mp3-duration
Support
    Quality
      Security
        License
          Reuse

            kandi-support Support

              mp3-duration has a low active ecosystem.
              It has 15 star(s) with 8 fork(s). There are 1 watchers for this library.
              OutlinedDot
              It had no major release in the last 6 months.
              There are 0 open issues and 7 have been closed. On average issues are closed in 50 days. There are no pull requests.
              It has a neutral sentiment in the developer community.
              The latest version of mp3-duration is current.

            kandi-Quality Quality

              mp3-duration has 0 bugs and 0 code smells.

            kandi-Security Security

              mp3-duration has no vulnerabilities reported, and its dependent libraries have no vulnerabilities reported.
              mp3-duration code analysis shows 0 unresolved vulnerabilities.
              There are 0 security hotspots that need review.

            kandi-License License

              mp3-duration is licensed under the MIT License. This license is Permissive.
              Permissive licenses have the least restrictions, and you can use them in most projects.

            kandi-Reuse Reuse

              mp3-duration releases are not available. You will need to build from source code and install.
              Installation instructions are not available. Examples and code snippets are available.

            Top functions reviewed by kandi - BETA

            kandi's functional review helps you automatically verify the functionalities of the libraries and avoid rework.
            Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of mp3-duration
            Get all kandi verified functions for this library.

            mp3-duration Key Features

            No Key Features are available at this moment for mp3-duration.

            mp3-duration Examples and Code Snippets

            No Code Snippets are available at this moment for mp3-duration.

            Community Discussions

            Trending Discussions on mp3-duration

            QUESTION

            Get duration of remote MP3 file without full download
            Asked 2018-May-30 at 16:19

            In a node.js script I need to get the duration of a remote MP3 file.

            Currently I use download and mp3-duration modules to download the file and then compute the duration. It works but the download phase is very long.

            I noticed that media players can display the duration almost instantly. Would it be somehow possible to get the duration without downloading the entire file first ?

            ...

            ANSWER

            Answered 2018-May-30 at 16:19
            ID3 Metadatas

            mp3 files comes (optionnaly) with metadata called "ID3 tags" :

            ID3 is a de facto standard for metadata in MP3 files


            ID3v1 enhanced tag
            • The ID3v1 tag occupies 128 bytes, beginning with the string TAG 128 bytes from the end of the file.
            • The Enhanced tag is 227 bytes long, and placed before the ID3v1 tag.

            The enhanced tag contains the start-time and end-time fields as the last 6 + 6 bytes of the tag formated like mmm:ss. So it gives you the duration of the song.

            The solution would be to download the 355 last bytes of the file and check if the enhanced tag (TAG+) is present, then look for the last 12 bytes of the enhanced tag.


            ID3v2 TLEN

            Nowdays, we're mostly using ID3v2 which allows us to embed up to 256MB of informations :

            ID3v2 tag is composed of frames. Each frame represents an information. Max frame size is 16MB. Max tag size is 256MB.

            The frame you're interested in is the TLEN frame, which represent the length of the song.

            But there is no guarantee that any mp3 file will have an ID3v2 tag or that the TLEN frame will be stored in its ID3v2 tag.

            /!\ /!\ /!\
            If the mp3 file does not contains metadata, the only solution is the one you already came up with : estimating the duration with the mp3-duration module.

            How to get these metadata without downloading the entire file ? Range requests

            If the server accepts Range Request, then we just have to tell him the bytes we want !

            ID3v1

            Source https://stackoverflow.com/questions/50503460

            Community Discussions, Code Snippets contain sources that include Stack Exchange Network

            Vulnerabilities

            No vulnerabilities reported

            Install mp3-duration

            You can download it from GitHub.
            Rust is installed and managed by the rustup tool. Rust has a 6-week rapid release process and supports a great number of platforms, so there are many builds of Rust available at any time. Please refer rust-lang.org for more information.

            Support

            Format referenceAudio test file sourceNon-audio test file source
            Find more information at:

            Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items

            Find more libraries
            CLONE
          • HTTPS

            https://github.com/agersant/mp3-duration.git

          • CLI

            gh repo clone agersant/mp3-duration

          • sshUrl

            git@github.com:agersant/mp3-duration.git

          • Stay Updated

            Subscribe to our newsletter for trending solutions and developer bootcamps

            Agree to Sign up and Terms & Conditions

            Share this Page

            share link