python-soundfile | SoundFile is an audio library based on libsndfile CFFI | Data Manipulation library

 by   bastibe Python Version: 0.12.1 License: BSD-3-Clause

kandi X-RAY | python-soundfile Summary

python-soundfile is a Python library typically used in Utilities, Data Manipulation, Numpy applications. python-soundfile has no bugs, it has no vulnerabilities, it has build file available, it has a Permissive License and it has low support. You can install using 'pip install python-soundfile' or download it from GitHub, PyPI.
SoundFile is an audio library based on libsndfile, CFFI, and NumPy
    Support
      Quality
        Security
          License
            Reuse
            Support
              Quality
                Security
                  License
                    Reuse

                      kandi-support Support

                        summary
                        python-soundfile has a low active ecosystem.
                        summary
                        It has 528 star(s) with 88 fork(s). There are 17 watchers for this library.
                        summary
                        There were 3 major release(s) in the last 6 months.
                        summary
                        There are 75 open issues and 119 have been closed. On average issues are closed in 146 days. There are 9 open pull requests and 0 closed requests.
                        summary
                        It has a neutral sentiment in the developer community.
                        summary
                        The latest version of python-soundfile is 0.12.1
                        python-soundfile Support
                          Best in #Data Manipulation
                            Average in #Data Manipulation
                            python-soundfile Support
                              Best in #Data Manipulation
                                Average in #Data Manipulation

                                  kandi-Quality Quality

                                    summary
                                    python-soundfile has 0 bugs and 0 code smells.
                                    python-soundfile Quality
                                      Best in #Data Manipulation
                                        Average in #Data Manipulation
                                        python-soundfile Quality
                                          Best in #Data Manipulation
                                            Average in #Data Manipulation

                                              kandi-Security Security

                                                summary
                                                python-soundfile has no vulnerabilities reported, and its dependent libraries have no vulnerabilities reported.
                                                summary
                                                python-soundfile code analysis shows 0 unresolved vulnerabilities.
                                                summary
                                                There are 0 security hotspots that need review.
                                                python-soundfile Security
                                                  Best in #Data Manipulation
                                                    Average in #Data Manipulation
                                                    python-soundfile Security
                                                      Best in #Data Manipulation
                                                        Average in #Data Manipulation

                                                          kandi-License License

                                                            summary
                                                            python-soundfile is licensed under the BSD-3-Clause License. This license is Permissive.
                                                            summary
                                                            Permissive licenses have the least restrictions, and you can use them in most projects.
                                                            python-soundfile License
                                                              Best in #Data Manipulation
                                                                Average in #Data Manipulation
                                                                python-soundfile License
                                                                  Best in #Data Manipulation
                                                                    Average in #Data Manipulation

                                                                      kandi-Reuse Reuse

                                                                        summary
                                                                        python-soundfile releases are available to install and integrate.
                                                                        summary
                                                                        Deployable package is available in PyPI.
                                                                        summary
                                                                        Build file is available. You can build the component from source.
                                                                        summary
                                                                        python-soundfile saves you 796 person hours of effort in developing the same functionality from scratch.
                                                                        summary
                                                                        It has 1908 lines of code, 200 functions and 10 files.
                                                                        summary
                                                                        It has high code complexity. Code complexity directly impacts maintainability of the code.
                                                                        python-soundfile Reuse
                                                                          Best in #Data Manipulation
                                                                            Average in #Data Manipulation
                                                                            python-soundfile Reuse
                                                                              Best in #Data Manipulation
                                                                                Average in #Data Manipulation
                                                                                  Top functions reviewed by kandi - BETA
                                                                                  kandi has reviewed python-soundfile and discovered the below as its top functions. This is intended to give you an instant insight into python-soundfile implemented functionality, and help decide if they suit your requirements.
                                                                                  • Create a SF_INFO struct
                                                                                    • Format an unsigned integer
                                                                                    • Get the format from the file extension
                                                                                    • Returns the default subtype for the given format
                                                                                    • Check format_str
                                                                                  • Open file
                                                                                    • Return True if the file has the virtual io attributes
                                                                                  • Clean up build files
                                                                                  • Sf version string
                                                                                  Get all kandi verified functions for this library.
                                                                                  Get all kandi verified functions for this library.

                                                                                  python-soundfile Key Features

                                                                                  SoundFile is an audio library based on libsndfile, CFFI, and NumPy

                                                                                  python-soundfile Examples and Code Snippets

                                                                                  No Code Snippets are available at this moment for python-soundfile.
                                                                                  Community Discussions

                                                                                  Trending Discussions on python-soundfile

                                                                                  Convert from opus to ogg file using ffmpeg [python soundfile]
                                                                                  chevron right

                                                                                  QUESTION

                                                                                  Convert from opus to ogg file using ffmpeg [python soundfile]
                                                                                  Asked 2021-Sep-27 at 16:16

                                                                                  I'm using python soundfile to audio files in one of my projects. I have a dataset that contains opus files.

                                                                                  python soundfile can not read opus files directly but can read ogg files. (https://github.com/bastibe/python-soundfile/issues/252)

                                                                                  How can I convert all the opus files to ogg files with ffmpeg?

                                                                                  I have tried the following command,

                                                                                   ffmpeg -i test_file_2.opus -c:a libvorbis -b:a 16k test_file_2.ogg
                                                                                  
                                                                                  

                                                                                  But I get an error,

                                                                                  ffmpeg version 4.3 Copyright (c) 2000-2020 the FFmpeg developers
                                                                                    built with gcc 7.3.0 (crosstool-NG 1.23.0.449-a04d0)
                                                                                    configuration: --prefix=/opt/conda --cc=/opt/conda/conda-bld/ffmpeg_1597178665428/_build_env/bin/x86_64-conda_cos6-linux-gnu-cc --disable-doc --disable-openssl --enable-avresample --enable-gnutls --enable-hardcoded-tables --enable-libfreetype --enable-libopenh264 --enable-pic --enable-pthreads --enable-shared --disable-static --enable-version3 --enable-zlib --enable-libmp3lame
                                                                                    libavutil      56. 51.100 / 56. 51.100
                                                                                    libavcodec     58. 91.100 / 58. 91.100
                                                                                    libavformat    58. 45.100 / 58. 45.100
                                                                                    libavdevice    58. 10.100 / 58. 10.100
                                                                                    libavfilter     7. 85.100 /  7. 85.100
                                                                                    libavresample   4.  0.  0 /  4.  0.  0
                                                                                    libswscale      5.  7.100 /  5.  7.100
                                                                                    libswresample   3.  7.100 /  3.  7.100
                                                                                  [ogg @ 0x55bad6b9cbc0] 543 bytes of comment header remain
                                                                                  Input #0, ogg, from 'test_file_2.opus':
                                                                                    Duration: 00:00:14.10, start: 0.000000, bitrate: 34 kb/s
                                                                                      Stream #0:0: Audio: opus, 48000 Hz, mono, fltp
                                                                                      Metadata:
                                                                                        album           : Onder Moeders Vleugels
                                                                                        ENCODER_OPTIONS : --quiet
                                                                                        artist          : Louisa May Alcott
                                                                                        title           : 02 - Een vroolijk kerstfeest
                                                                                        encoder         : opusenc from opus-tools 0.1.10;Lavf57.83.100
                                                                                  Unknown encoder 'libvorbis'
                                                                                  
                                                                                  

                                                                                  ANSWER

                                                                                  Answered 2021-Sep-27 at 11:13

                                                                                  I'm using librosa right now for conversion, but this is extremely slow:

                                                                                  # converting opus to ogg files for reading audio files with python soundfile
                                                                                  from glob import glob
                                                                                  from tqdm import tqdm
                                                                                  import soundfile as sf 
                                                                                  import librosa
                                                                                  import os
                                                                                  
                                                                                  for f in tqdm(glob("/Data/AUDIO_DATA/mls_dutch_opus/*/audio/*/*/*.opus") + glob("/Data/AUDIO_DATA/mls_german_opus/*/audio/*/*/*.opus")):
                                                                                      audio, sr = librosa.load(f, res_type='kaiser_fast', sr = 16000)
                                                                                      sf.write(f.replace(".opus", ".ogg"), audio, sr, format='ogg', subtype='vorbis')
                                                                                      os.remove(f)
                                                                                  

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

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

                                                                                  Vulnerabilities

                                                                                  No vulnerabilities reported

                                                                                  Install python-soundfile

                                                                                  You can install using 'pip install python-soundfile' or download it from GitHub, PyPI.
                                                                                  You can use python-soundfile like any standard Python library. You will need to make sure that you have a development environment consisting of a Python distribution including header files, a compiler, pip, and git installed. Make sure that your pip, setuptools, and wheel are up to date. When using pip it is generally recommended to install packages in a virtual environment to avoid changes to the system.

                                                                                  Support

                                                                                  For any new features, suggestions and bugs create an issue on GitHub. If you have any questions check and ask questions on community page Stack Overflow .
                                                                                  Find more information at:
                                                                                  Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
                                                                                  Find more libraries
                                                                                  Explore Kits - Develop, implement, customize Projects, Custom Functions and Applications with kandi kits​
                                                                                  Save this library and start creating your kit
                                                                                  CLONE
                                                                                • HTTPS

                                                                                  https://github.com/bastibe/python-soundfile.git

                                                                                • CLI

                                                                                  gh repo clone bastibe/python-soundfile

                                                                                • sshUrl

                                                                                  git@github.com:bastibe/python-soundfile.git

                                                                                • Share this Page

                                                                                  share link

                                                                                  Explore Related Topics

                                                                                  Consider Popular Data Manipulation Libraries

                                                                                  Try Top Libraries by bastibe

                                                                                  SoundCard

                                                                                  by bastibePython

                                                                                  SoundFile

                                                                                  by bastibePython

                                                                                  lunatic-python

                                                                                  by bastibeC

                                                                                  PySoundCard

                                                                                  by bastibePython

                                                                                  simple-cython-limiter

                                                                                  by bastibePython

                                                                                  Compare Data Manipulation Libraries with Highest Support

                                                                                  numpy

                                                                                  by numpy

                                                                                  hapi-fhir

                                                                                  by jamesagnew

                                                                                  nbconvert

                                                                                  by jupyter

                                                                                  protege

                                                                                  by protegeproject

                                                                                  database

                                                                                  by blazegraph

                                                                                  Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
                                                                                  Find more libraries
                                                                                  Explore Kits - Develop, implement, customize Projects, Custom Functions and Applications with kandi kits​
                                                                                  Save this library and start creating your kit