PyOgg


NamePyOgg JSON
Version 0.6.14a1 PyPI version JSON
download
home_pagehttps://github.com/Zuzu-Typ/PyOgg
SummaryXiph.org's Ogg Vorbis, Opus and FLAC for Python
upload_time2020-06-26 12:51:57
maintainer
docs_urlNone
authorZuzu_Typ
requires_python
licenseBSD 3-clause "New" or "Revised"
keywords xiph ogg vorbis opus flac sound playback audio
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI
coveralls test coverage No coveralls.
            # PyOgg

PyOgg provides bindings for Xiph.org's OGG Vorbis, OGG Opus and FLAC audio file formats.

It comes bundled with the required dynamic libraries (.dll) in the Windows WHEEL (.whl) distributions.

The required libraries include the OGG library (e.g. libogg.dll) and at least either OGG Opus' libraries (e.g. libopus.dll, libopusfile.dll) and / or OGG Vorbis' libraries (e.g. libvorbis.dll, libvorbisfile.dll) 
to support Opus and Vorbis respectively, or the FLAC C library (e.g. libFLAC.dll) for FLAC support.

You can install PyOgg using PyPI.

	pip install PyOgg


All the functions, structures and datatypes are the same as in the C++ implementation, except for some that couldn't be translated.
If you want to use them natively you will have to use ctypes' data types.
Please refer to the official documentation and the C++ headers.

You can import the various functions from pyogg.ogg, pyogg.vorbis, pyogg.opus and pyogg.flac or use the predefined classes and functions from pyogg.

PyOgg is not capable of playing files, however, you can use OpenAL for normal or even 3D playback with [PyOpenAL](https://github.com/Zuzu-Typ/PyOpenAL).

Here's a reference for PyOgg's own classes and functions:

	<class> pyogg.VorbisFile(path)
		# opens and reads an OGG Vorbis file to a buffer. 
			<str> path # path to the file (can be relative or absolute)

		<int> VorbisFile.channels
			# how many audio channels the audio data has (1 = mono, 2 = stereo, etc.)

		<int> VorbisFile.frequency
			# audio frequency (e.g. 48000, 44100, etc.)

		<str or bytes> VorbisFile.buffer
			# audio data

		<int> VorbisFile.buffer_length
			# length of the buffer

	<class> pyogg.OpusFile(path)
		# opens and reads an OGG Opus file to a buffer. 
			<str> path # path to the file (can be relative or absolute)

		<int> OpusFile.channels
			# how many audio channels the audio data has (1 = mono, 2 = stereo, etc.)

		<int> OpusFile.frequency
			# audio frequency (always 48000)

		<opus_int16_p> OpusFile.buffer
			# audio data

		<int> OpusFile.buffer_length
			# length of the buffer

	<class> pyogg.FlacFile(path)
		# opens and reads a FLAC file to a buffer. 
			<str> path # path to the file (can be relative or absolute)

		<int> FlacFile.channels
			# how many audio channels the audio data has (1 = mono, 2 = stereo, etc.)

		<int> FlacFile.frequency
			# audio frequency (e.g. 48000, 44100, etc.)

		<FLAC__int16_Array> FlacFile.buffer
			# audio data

		<int> FlacFile.buffer_length
			# length of the buffer

	<class> pyogg.VorbisFileStream(path)
		# opens an OGG Vorbis file and prepares it for repeated reading. 
			<str> path # path to the file (can be relative or absolute)

		<vorbis.OggVorbis_File> VorbisFileStream.vf
			# Vorbis audio file stream

		<int> VorbisFileStream.channels
			# how many audio channels the audio data has (1 = mono, 2 = stereo, etc.)

		<int> VorbisFileStream.frequency
			# audio frequency (always 48000)

		<method> get_buffer() -> [buffer, buffer_length] or None
			# reads some audio data into a buffer (to set the buffer size, see pyoggSetStreamBufferSize)
			# if the file reaches it's end this method returns None
				<str or bytes> buffer # a buffer containing some audio data
				<int> buffer_length   # length of the buffer

		<method> clean_up() -> None
			# deletes the buffer and closes the file

	<class> pyogg.OpusFileStream(path)
		# opens an OGG Opus file and prepares it for repeated reading. 
			<str> path # path to the file (can be relative or absolute)

		<opus.OggOpusFile> OpusFileStream.of
			# Opus audio file stream

		<int> OpusFileStream.channels
			# how many audio channels the audio data has (1 = mono, 2 = stereo, etc.)

		<int> OpusFileStream.frequency
			# audio frequency (always 48000)

		<method> get_buffer() -> [buffer, buffer_length] or None
			# reads some audio data into a buffer (to set the buffer size, see pyoggSetStreamBufferSize)
			# if the file reaches it's end this method returns None
				<opus_int16_p> buffer # a buffer containing some audio data
				<int> buffer_length   # length of the buffer

		<method> clean_up() -> None
			# deletes the buffer and closes the file

	<class> pyogg.FlacFileStream(path)
		# opens a FLAC file and prepares it for repeated reading. 
			<str> path # path to the file (can be relative or absolute)

		<FLAC__StreamDecoder> FlacFileStream.decoder
			# FLAC audio file stream decoder

		<int> FlacFileStream.channels
			# how many audio channels the audio data has (1 = mono, 2 = stereo, etc.)

		<int> FlacFileStream.frequency
			# audio frequency (e.g. 48000, 44100, etc.)

		<method> get_buffer() -> [buffer, buffer_length] or None
			# reads some audio data into a buffer (to set the buffer size, see pyoggSetStreamBufferSize)
			# if the file reaches it's end this method returns None
				<FLAC__int16_Array> buffer # a buffer containing some audio data
				<int> buffer_length   # length of the buffer

		<method> clean_up() -> None
			# deletes the buffer and closes the file

	<method> pyogg.pyoggSetStreamBufferSize(size)
		# changes the maximum size for stream buffers (initially 8192)
			<int> size # how much data each stream buffer holds




            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/Zuzu-Typ/PyOgg",
    "name": "PyOgg",
    "maintainer": "",
    "docs_url": null,
    "requires_python": "",
    "maintainer_email": "",
    "keywords": "Xiph ogg vorbis opus flac sound playback audio",
    "author": "Zuzu_Typ",
    "author_email": "zuzu.typ@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/1a/13/07358440dc3e94a71f3cd0f734e90b41392cc125de1571a99c4f8b594ccb/PyOgg-0.6.14a1.tar.gz",
    "platform": "",
    "description": "# PyOgg\n\nPyOgg provides bindings for Xiph.org's OGG Vorbis, OGG Opus and FLAC audio file formats.\n\nIt comes bundled with the required dynamic libraries (.dll) in the Windows WHEEL (.whl) distributions.\n\nThe required libraries include the OGG library (e.g. libogg.dll) and at least either OGG Opus' libraries (e.g. libopus.dll, libopusfile.dll) and / or OGG Vorbis' libraries (e.g. libvorbis.dll, libvorbisfile.dll) \nto support Opus and Vorbis respectively, or the FLAC C library (e.g. libFLAC.dll) for FLAC support.\n\nYou can install PyOgg using PyPI.\n\n\tpip install PyOgg\n\n\nAll the functions, structures and datatypes are the same as in the C++ implementation, except for some that couldn't be translated.\nIf you want to use them natively you will have to use ctypes' data types.\nPlease refer to the official documentation and the C++ headers.\n\nYou can import the various functions from pyogg.ogg, pyogg.vorbis, pyogg.opus and pyogg.flac or use the predefined classes and functions from pyogg.\n\nPyOgg is not capable of playing files, however, you can use OpenAL for normal or even 3D playback with [PyOpenAL](https://github.com/Zuzu-Typ/PyOpenAL).\n\nHere's a reference for PyOgg's own classes and functions:\n\n\t<class> pyogg.VorbisFile(path)\n\t\t# opens and reads an OGG Vorbis file to a buffer. \n\t\t\t<str> path # path to the file (can be relative or absolute)\n\n\t\t<int> VorbisFile.channels\n\t\t\t# how many audio channels the audio data has (1 = mono, 2 = stereo, etc.)\n\n\t\t<int> VorbisFile.frequency\n\t\t\t# audio frequency (e.g. 48000, 44100, etc.)\n\n\t\t<str or bytes> VorbisFile.buffer\n\t\t\t# audio data\n\n\t\t<int> VorbisFile.buffer_length\n\t\t\t# length of the buffer\n\n\t<class> pyogg.OpusFile(path)\n\t\t# opens and reads an OGG Opus file to a buffer. \n\t\t\t<str> path # path to the file (can be relative or absolute)\n\n\t\t<int> OpusFile.channels\n\t\t\t# how many audio channels the audio data has (1 = mono, 2 = stereo, etc.)\n\n\t\t<int> OpusFile.frequency\n\t\t\t# audio frequency (always 48000)\n\n\t\t<opus_int16_p> OpusFile.buffer\n\t\t\t# audio data\n\n\t\t<int> OpusFile.buffer_length\n\t\t\t# length of the buffer\n\n\t<class> pyogg.FlacFile(path)\n\t\t# opens and reads a FLAC file to a buffer. \n\t\t\t<str> path # path to the file (can be relative or absolute)\n\n\t\t<int> FlacFile.channels\n\t\t\t# how many audio channels the audio data has (1 = mono, 2 = stereo, etc.)\n\n\t\t<int> FlacFile.frequency\n\t\t\t# audio frequency (e.g. 48000, 44100, etc.)\n\n\t\t<FLAC__int16_Array> FlacFile.buffer\n\t\t\t# audio data\n\n\t\t<int> FlacFile.buffer_length\n\t\t\t# length of the buffer\n\n\t<class> pyogg.VorbisFileStream(path)\n\t\t# opens an OGG Vorbis file and prepares it for repeated reading. \n\t\t\t<str> path # path to the file (can be relative or absolute)\n\n\t\t<vorbis.OggVorbis_File> VorbisFileStream.vf\n\t\t\t# Vorbis audio file stream\n\n\t\t<int> VorbisFileStream.channels\n\t\t\t# how many audio channels the audio data has (1 = mono, 2 = stereo, etc.)\n\n\t\t<int> VorbisFileStream.frequency\n\t\t\t# audio frequency (always 48000)\n\n\t\t<method> get_buffer() -> [buffer, buffer_length] or None\n\t\t\t# reads some audio data into a buffer (to set the buffer size, see pyoggSetStreamBufferSize)\n\t\t\t# if the file reaches it's end this method returns None\n\t\t\t\t<str or bytes> buffer # a buffer containing some audio data\n\t\t\t\t<int> buffer_length   # length of the buffer\n\n\t\t<method> clean_up() -> None\n\t\t\t# deletes the buffer and closes the file\n\n\t<class> pyogg.OpusFileStream(path)\n\t\t# opens an OGG Opus file and prepares it for repeated reading. \n\t\t\t<str> path # path to the file (can be relative or absolute)\n\n\t\t<opus.OggOpusFile> OpusFileStream.of\n\t\t\t# Opus audio file stream\n\n\t\t<int> OpusFileStream.channels\n\t\t\t# how many audio channels the audio data has (1 = mono, 2 = stereo, etc.)\n\n\t\t<int> OpusFileStream.frequency\n\t\t\t# audio frequency (always 48000)\n\n\t\t<method> get_buffer() -> [buffer, buffer_length] or None\n\t\t\t# reads some audio data into a buffer (to set the buffer size, see pyoggSetStreamBufferSize)\n\t\t\t# if the file reaches it's end this method returns None\n\t\t\t\t<opus_int16_p> buffer # a buffer containing some audio data\n\t\t\t\t<int> buffer_length   # length of the buffer\n\n\t\t<method> clean_up() -> None\n\t\t\t# deletes the buffer and closes the file\n\n\t<class> pyogg.FlacFileStream(path)\n\t\t# opens a FLAC file and prepares it for repeated reading. \n\t\t\t<str> path # path to the file (can be relative or absolute)\n\n\t\t<FLAC__StreamDecoder> FlacFileStream.decoder\n\t\t\t# FLAC audio file stream decoder\n\n\t\t<int> FlacFileStream.channels\n\t\t\t# how many audio channels the audio data has (1 = mono, 2 = stereo, etc.)\n\n\t\t<int> FlacFileStream.frequency\n\t\t\t# audio frequency (e.g. 48000, 44100, etc.)\n\n\t\t<method> get_buffer() -> [buffer, buffer_length] or None\n\t\t\t# reads some audio data into a buffer (to set the buffer size, see pyoggSetStreamBufferSize)\n\t\t\t# if the file reaches it's end this method returns None\n\t\t\t\t<FLAC__int16_Array> buffer # a buffer containing some audio data\n\t\t\t\t<int> buffer_length   # length of the buffer\n\n\t\t<method> clean_up() -> None\n\t\t\t# deletes the buffer and closes the file\n\n\t<method> pyogg.pyoggSetStreamBufferSize(size)\n\t\t# changes the maximum size for stream buffers (initially 8192)\n\t\t\t<int> size # how much data each stream buffer holds\n\n\n\n",
    "bugtrack_url": null,
    "license": "BSD 3-clause \"New\" or \"Revised\"",
    "summary": "Xiph.org's Ogg Vorbis, Opus and FLAC for Python",
    "version": "0.6.14a1",
    "project_urls": {
        "Homepage": "https://github.com/Zuzu-Typ/PyOgg"
    },
    "split_keywords": [
        "xiph",
        "ogg",
        "vorbis",
        "opus",
        "flac",
        "sound",
        "playback",
        "audio"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "19b8aa50bedf5628dc66a88a3aa6554b91a3f931baf2b221ece3a8525278b667",
                "md5": "c57a076cc3dd1a70e7afda81c9c2ae40",
                "sha256": "794db340fb5833afb4f493b40f91e3e0f594606fd4b31aea0ebf5be2de9da964"
            },
            "downloads": -1,
            "filename": "PyOgg-0.6.14a1-py2.py3-none-win32.whl",
            "has_sig": false,
            "md5_digest": "c57a076cc3dd1a70e7afda81c9c2ae40",
            "packagetype": "bdist_wheel",
            "python_version": "py2.py3",
            "requires_python": null,
            "size": 1037870,
            "upload_time": "2020-06-26T12:51:52",
            "upload_time_iso_8601": "2020-06-26T12:51:52.764207Z",
            "url": "https://files.pythonhosted.org/packages/19/b8/aa50bedf5628dc66a88a3aa6554b91a3f931baf2b221ece3a8525278b667/PyOgg-0.6.14a1-py2.py3-none-win32.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "521434b6b82684f26e517f6947d9c1d43e64dbf1630954f284ffd9912f4c46c8",
                "md5": "00bde52ff4aba376cfde294af4419607",
                "sha256": "40f79b288b3a667309890885f4cf53371163b7dae17eb17567fb24ab467eca26"
            },
            "downloads": -1,
            "filename": "PyOgg-0.6.14a1-py2.py3-none-win_amd64.whl",
            "has_sig": false,
            "md5_digest": "00bde52ff4aba376cfde294af4419607",
            "packagetype": "bdist_wheel",
            "python_version": "py2.py3",
            "requires_python": null,
            "size": 1099508,
            "upload_time": "2020-06-26T12:51:55",
            "upload_time_iso_8601": "2020-06-26T12:51:55.912791Z",
            "url": "https://files.pythonhosted.org/packages/52/14/34b6b82684f26e517f6947d9c1d43e64dbf1630954f284ffd9912f4c46c8/PyOgg-0.6.14a1-py2.py3-none-win_amd64.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "1a1307358440dc3e94a71f3cd0f734e90b41392cc125de1571a99c4f8b594ccb",
                "md5": "4c10390cccc9aecafa2aebbd19692a08",
                "sha256": "8294b34aa59c90200c4630c2cc4a5b84407209141e8e5d069d7a5be358e94262"
            },
            "downloads": -1,
            "filename": "PyOgg-0.6.14a1.tar.gz",
            "has_sig": false,
            "md5_digest": "4c10390cccc9aecafa2aebbd19692a08",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 35091,
            "upload_time": "2020-06-26T12:51:57",
            "upload_time_iso_8601": "2020-06-26T12:51:57.378524Z",
            "url": "https://files.pythonhosted.org/packages/1a/13/07358440dc3e94a71f3cd0f734e90b41392cc125de1571a99c4f8b594ccb/PyOgg-0.6.14a1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2020-06-26 12:51:57",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "Zuzu-Typ",
    "github_project": "PyOgg",
    "travis_ci": true,
    "coveralls": false,
    "github_actions": false,
    "lcname": "pyogg"
}
        
Elapsed time: 0.11899s